cowork/.opencode/skill/command-creator/SKILL.md
Create custom /slash commands for repetitive tasks. Use proactively for command creation, prompt automation, or workflow shortcuts. Examples: - user: "Make a /test command that runs pytest" → create command in opencode.json, set prompt to run tests with bash tool - user: "Add a /review command for PRs" → design prompt to fetch diff, analyze changes, generate review comments - user: "Automate this repetitive task" → identify pattern, create slash command with parameterized prompt - user: "Make a /deploy command" → design workflow (build, test, deploy), encode in command prompt
npx skillsauth add igorwarzocha/opencode-workflows command-creatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create custom slash commands for repetitive tasks in OpenCode.
<core_approach>
Command creation is conversational, not transactional.
</core_approach>
<question_tool>
Batching: Use the question tool for 2+ related questions. Single questions → plain text.
Syntax: header ≤12 chars, label 1-5 words, add "(Recommended)" to default.
When to ask: Vague request ("make a command"), or multiple implementation approaches exist.
</question_tool>
<reference>| Scope | Path |
| ------- | -------------------------------------- |
| Project | .opencode/command/<name>.md |
| Global | ~/.config/opencode/command/<name>.md |
$ARGUMENTS, $1, @filename, etc.) MUST be inserted ONLY ONCE in the command body.$ARGUMENTS) over complex positional ones unless strictly necessary.BAD: "Do $ARGUMENTS and then check $ARGUMENTS for errors."
GOOD:
<user_guidelines>
$ARGUMENTS
</user_guidelines>
<context>
@src/schema.ts
</context>
<objective>
Analyze findings based on user guidelines and the provided schema.
</objective>
| Placeholder | Description | Example |
| ---------------- | ---------------------- | ----------------------------------- |
| $ARGUMENTS | All arguments passed | /cmd foo bar → "foo bar" |
| $1, $2, $3 | Positional arguments | /cmd foo bar → $1="foo", $2="bar" |
| !command | Shell output injection | !ls -F |
| @filename | Include file content | @src/index.ts |
---
description: 3-word command summary
agent: build # Optional: build, plan, or custom agent
model: provider/model-id # Optional: override model
subtask: true # Optional: run as subagent
---
<summary>
Line 1: You MUST [purpose].
Line 2: You SHOULD [inputs].
Line 3: You MUST [outcome].
</summary>
<user_guidelines>
$ARGUMENTS
</user_guidelines>
Template body goes here.
| Field | Purpose | Required |
| ------------- | ------------------------- | ----------- |
| description | Shown in command list | RECOMMENDED |
| agent | Route to specific agent | No |
| model | Override model | No |
| subtask | Force subagent invocation | No |
Use the !command syntax to inject bash output into your prompt. The shell execution is triggered by an exclamation mark followed by the command wrapped in backticks:
Review recent changes:
!`git log --oneline -10`
Suggest improvements.
Use @ to include file content:
Given the schema in @prisma/schema.prisma, generate a migration for $ARGUMENTS.
<workflow>
"What task do you want to automate?"
"Can you show me how you'd normally ask for this?"
"Does it need arguments?"
/command foo bar → $ARGUMENTS = "foo bar", $1 = "foo", $2 = "bar""Should it make changes or just analyze?"
agent: plan"Should it run as a background subtask?"
subtask: true"Project-specific or use everywhere?"
.opencode/command/~/.config/opencode/command/Be flexible: If user provides lots of info upfront, adapt—MUST NOT rigidly ask every question.
</workflow> <examples>---
description: Run tests and fix failures
---
<summary>
You MUST run the full test suite.
You SHOULD identify and fix failures.
You MUST re-verify fixes.
</summary>
<objective>
You MUST run the full test suite, find the root cause of any failures, and fix the issue.
</objective>
1. Show the failing test
2. Identify the root cause
3. Fix the issue
4. Re-run to verify
---
description: Review code for issues
agent: plan
---
<summary>
You MUST review $ARGUMENTS for issues.
You SHOULD check for bugs, security, and performance.
You MUST provide actionable feedback.
</summary>
<objective>
You MUST review $ARGUMENTS for bugs, security, and performance issues and provide actionable feedback without making changes.
</objective>
- Bugs and edge cases
- Security issues
- Performance problems
---
description: Stage and commit with conventional prefix
---
<summary>
You MUST analyze changes and stage files.
You SHOULD choose a conventional commit prefix.
You MUST commit with a concise message.
</summary>
<context>
!`git status`
!`git diff`
</context>
<objective>
You MUST analyze changes, stage relevant files, and commit with a concise message.
</objective>
1. Analyze all changes
2. Choose appropriate prefix: docs:, feat:, fix:, refactor:, test:, ci:
3. Write concise commit message (imperative mood)
4. Stage relevant files and commit
---
description: Check spelling in markdown files
subtask: true
---
<summary>
You MUST find unstaged markdown files.
You SHOULD check them for spelling errors.
You MUST report any found errors.
</summary>
Check spelling in all unstaged markdown files:
<context>
!`git diff --name-only | grep -E '\.md$'`
</context>
<objective>
You MUST check for and report any spelling errors found in unstaged markdown files.
</objective>
---
description: Search GitHub issues
model: anthropic/claude-3-5-haiku-20241022
subtask: true
---
<summary>
You MUST search GitHub issues for $ARGUMENTS.
You SHOULD limit results to the top 10.
You MUST summarize the relevant issues.
</summary>
Search GitHub issues matching: $ARGUMENTS
<context>
!`gh issue list --search "$ARGUMENTS" --limit 10`
</context>
<objective>
You MUST summarize the top 10 relevant GitHub issues found for $ARGUMENTS.
</objective>
---
description: Create a new React component
---
<summary>
You MUST create a React component named $1.
You SHOULD include TypeScript props and basic styling.
You MUST provide a unit test file.
</summary>
Create a React component named $1 in $2 with:
<objective>
You MUST create a React component with TypeScript props and basic styling, and provide a corresponding unit test file.
</objective>
- TypeScript props interface
- Basic styling
- Unit test file
Usage: /component UserProfile src/components
---
description: Generate database migration
---
<summary>
You MUST read the Prisma schema.
You SHOULD generate a migration for $ARGUMENTS.
You MUST ensure the migration matches the schema.
</summary>
Given the schema in @prisma/schema.prisma:
<context>
@prisma/schema.prisma
</context>
<objective>
You MUST generate a Prisma migration for $ARGUMENTS that matches the provided schema.
</objective>
</examples>
<quality_checklist>
Before delivering:
</quality_checklist>
<best_practices>
| Do | Don't |
| ------------------------------------- | ------------------------------------- |
| Keep templates focused | Cram multiple tasks in one |
| Use $1, $2 for structured args | Rely only on $ARGUMENTS for multi-arg |
| Use !cmd to gather context | Hardcode dynamic values |
| Use @file for config/schema refs | Copy-paste file contents |
| Set agent: plan for read-only | Forget agent for reviews |
| Set subtask: true for parallel work | Block main session unnecessarily |
</best_practices>
development
Handle structured co-authoring of professional documentation. Use for proposals, technical specs, and RFCs. Use proactively when a collaborative drafting process (Gathering -> Refinement -> Testing) is needed. Examples: - user: "Draft a technical RFC for the new API" -> follow Stage 1 context gathering - user: "Refine the introduction of this proposal" -> use iterative surgical edits - user: "Test if this document is clear for readers" -> run reader testing workflow
development
Handle Word document (.docx) creation, editing, and analysis with high-fidelity visual review. Use for professional reports, legal documents, and tracked changes. Use proactively when quality and precise formatting are critical. Examples: - user: "Create a professional report in Word" -> use python-docx with render loops - user: "Draft a legal contract with redlines" -> use ooxml redlining workflow - user: "Extract text from this DOCX while preserving structure" -> use pandoc markdown conversion
testing
Apply professional visual themes to documents and presentations. Use for styling artifacts with consistent color palettes and font pairings. Use proactively to quickly improve the aesthetic quality of deliverables. Examples: - user: "Apply a modern theme to this deck" -> use Modern Minimalist theme - user: "I want a tech aesthetic for this doc" -> apply Tech Innovation theme - user: "Create a custom theme for my project" -> generate new color/font specification
tools
Guide for creating effective opencode skills. Use for creating or updating skills that extend agent capabilities with specialized knowledge, workflows, or tool integrations. Examples: - user: "Create a skill for git workflows" → define SKILL.md with instructions and examples - user: "Add examples to my skill" → follow the user: "query" → action pattern - user: "Update skill description" → use literal block scalar and trigger contexts - user: "Structure a complex skill" → organize with scripts/ and references/ directories - user: "Validate my skill" → check structure, frontmatter, and discovery triggers