スキル一覧に戻る
IgorWarzocha

command-creator

by IgorWarzocha

An ever evolving repository of Opencode workflow examples that might enhance your experience with it. I only left the stuff that actually works. YMMV.

51🍴 6📅 2026年1月22日
GitHubで見るManusで実行

SKILL.md


name: command-creator description: |- 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

Command Creator

Create custom slash commands for repetitive tasks in OpenCode.

<core_approach>

Command creation is conversational, not transactional.

  • MUST NOT assume what the user wants—ask
  • SHOULD start simple, add complexity only if needed
  • MUST show drafts and iterate based on feedback

</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>

Command Locations

ScopePath
Project.opencode/command/<name>.md
Global~/.config/opencode/command/<name>.md

Command File Format

---
description: What this command does (shown in /help)
agent: build              # Optional: build, plan, or custom agent
model: provider/model-id  # Optional: override model
subtask: true             # Optional: run as subagent
---

Template body goes here.

Frontmatter Options

FieldPurposeRequired
descriptionShown in command listRECOMMENDED
agentRoute to specific agentNo
modelOverride modelNo
subtaskForce subagent invocationNo

Conceptual Boundary (CRITICAL)

  • Commands are for USERS: They are keyboard shortcuts for humans.
  • Agents use TOOLS: Agents cannot "type" or "invoke" slash commands (e.g., an agent cannot call /test).
  • One-Way Street: User → Command → Agent. Never Agent → Command.
  • If logic needs to be shared, put it in a Skill (script/instruction), not a Command.

Template Placeholders

PlaceholderDescriptionExample
$ARGUMENTSAll arguments passed/cmd foo bar → "foo bar"
$1, $2, $3Positional arguments/cmd foo bar → $1="foo", $2="bar"
`!command`Shell output (runs bash)`!git status`
@filenameInclude file content@src/index.ts

Shell Commands in Templates

Use backticks with ! to run shell commands and include output:

Review the current changes:

`!git diff --staged`

Suggest improvements.

File References

Use @ to include file content:

Given the schema in @prisma/schema.prisma, generate a migration for $ARGUMENTS.

Built-in Commands

CommandDescriptionSubtask
/initCreate/update AGENTS.mdNo
/reviewReview git changes (defaults to uncommitted)Yes

Phase 1: Understand the Task

  1. "What task do you want to automate?"

    • Get the repetitive prompt/workflow
    • Examples: "run tests", "review this file", "create a component"
  2. "Can you show me how you'd normally ask for this?"

    • Get the actual prompt they'd type
    • This becomes the template body

Phase 2: Inputs & Routing

  1. "Does it need arguments?"

    • If they mention "this file", "a name", "the function" → yes
    • Explain: /command foo bar$ARGUMENTS = "foo bar", $1 = "foo", $2 = "bar"
  2. "Should it make changes or just analyze?"

    • Changes → default agent (build)
    • Analysis only → set agent: plan
  3. "Should it run as a background subtask?"

    • Long-running or parallel work → set subtask: true
    • Interactive or quick → leave unset
  4. "Project-specific or use everywhere?"

    • Project → .opencode/command/
    • Global → ~/.config/opencode/command/

Phase 3: Review & Refine

  1. Show the draft command, ask for feedback
    • "Here's what I've created. Want to adjust anything?"
    • Iterate until user is satisfied

Be flexible: If user provides lots of info upfront, adapt—MUST NOT rigidly ask every question.

/test - Run and Fix Tests

---
description: Run tests and fix failures
---

Run the full test suite. For any failures:
1. Show the failing test
2. Identify the root cause  
3. Fix the issue
4. Re-run to verify

/review - Code Review (Read-Only)

---
description: Review code for issues
agent: plan
---

Review $ARGUMENTS for:
- Bugs and edge cases
- Security issues
- Performance problems

Provide actionable feedback without making changes.

/commit - Smart Commit with Prefixes

---
description: Stage and commit with conventional prefix
---

1. Run `git status` and `git diff`
2. Analyze all changes
3. Choose appropriate prefix: docs:, feat:, fix:, refactor:, test:, ci:
4. Write concise commit message (imperative mood)
5. Stage relevant files and commit

/spellcheck - Check Spelling

---
description: Check spelling in markdown files
subtask: true
---

Check spelling in all unstaged markdown files:

`!git diff --name-only | grep -E '\.md$'`

Report any spelling errors found.

/issues - Search GitHub Issues

---
description: Search GitHub issues
model: anthropic/claude-3-5-haiku-20241022
subtask: true
---

Search GitHub issues matching: $ARGUMENTS

`!gh issue list --search "$ARGUMENTS" --limit 10`

Summarize the relevant issues.

/component - Create Component

---
description: Create a new React component
---

Create a React component named $1 in $2 with:
- TypeScript props interface
- Basic styling
- Unit test file

Usage: /component UserProfile src/components

/migrate - Database Migration

---
description: Generate database migration
---

Given the schema in @prisma/schema.prisma:

Generate a migration for: $ARGUMENTS

<quality_checklist>

Before delivering:

  • Asked what task to automate
  • Got example of how they'd normally prompt it
  • Determined if arguments needed ($ARGUMENTS vs $1, $2)
  • Set appropriate agent (plan for read-only)
  • Considered subtask for long-running work
  • Chose project vs global scope
  • Showed draft and got feedback

</quality_checklist>

<best_practices>

DoDon't
Keep templates focusedCram multiple tasks in one
Use $1, $2 for structured argsRely only on $ARGUMENTS for multi-arg
Use `!cmd` to gather contextHardcode dynamic values
Use @file for config/schema refsCopy-paste file contents
Set agent: plan for read-onlyForget agent for reviews
Set subtask: true for parallel workBlock main session unnecessarily

</best_practices>

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です