Loading...
Loading...
This skill should be used when the user asks to "create a command", "add a custom command", "make a slash command", "create /command", or needs guidance on creating custom commands in OpenCode.
npx skill4agent add the-perfect-developer/the-perfect-opencode command-creationagentmodelopencode.jsonmodelagent:buildplan---
description: Brief description
agent: build # or: plan
---model:opencode.json/command-namemkdir -p .opencode/commands
touch .opencode/commands/test.mdtest.md---
description: Run tests with coverage
agent: build
model: anthropic/claude-3-5-sonnet-20241022
---
Run the full test suite with coverage report and show any failures.
Focus on the failing tests and suggest fixes./test.opencode/commands/command-name.md~/.config/opencode/commands/command-name.mdcommands/.opencode/commands/
├── test.md # /test command
├── review.md # /review command
└── component.md # /component command.opencode/commands/review.md
---
description: Review code changes
agent: plan
---
Review recent git commits:
!`git log --oneline -10`
Review these changes and suggest any improvements.descriptionagentsubtaskmodelopencode.jsonopencode.jsonccommand{
"$schema": "https://opencode.ai/config.json",
"command": {
"test": {
"template": "Run the full test suite with coverage report and show any failures.\nFocus on the failing tests and suggest fixes.",
"description": "Run tests with coverage",
"agent": "build",
"model": "anthropic/claude-3-5-sonnet-20241022"
}
}
}$ARGUMENTS.opencode/commands/component.md
---
description: Create a new component
---
Create a new React component named $ARGUMENTS with TypeScript support.
Include proper typing and basic structure./component Button$ARGUMENTSButton.opencode/commands/create-file.md
---
description: Create a new file with content
---
Create a file named $1 in the directory $2
with the following content: $3/create-file config.json src "{ \"key\": \"value\" }"$1config.json$2src$3{ "key": "value" }commandcommand.opencode/commands/analyze-coverage.md
---
description: Analyze test coverage
---
Here are the current test results:
!`npm test`
Based on these results, suggest improvements to increase coverage.
Recent commits:
!`git log --oneline -10`
Current branch status:
!`git status`
Package versions:
!`npm list --depth=0`@.opencode/commands/review-component.md
---
description: Review component
---
Review the component in @src/components/Button.tsx.
Check for performance issues and suggest improvements.
Compare @src/old-api.ts and @src/new-api.ts.
Identify breaking changes and migration steps.{
"command": {
"test": {
"template": "Run tests and report failures."
}
}
}{
"command": {
"test": {
"description": "Run tests with coverage"
}
}
}---
description: Run tests with coverage
---buildplanbuildplan{
"command": {
"review": {
"agent": "plan"
}
}
}---
agent: plan
---subtask: false{
"command": {
"analyze": {
"subtask": true
}
}
}---
subtask: true
---modeprimary{
"command": {
"analyze": {
"model": "anthropic/claude-3-5-sonnet-20241022"
}
}
}---
model: anthropic/claude-3-5-sonnet-20241022
---.opencode/commands/test.md
---
description: Run tests with coverage
agent: build
---
Run the full test suite with coverage report:
!`npm test -- --coverage`
Analyze failures and suggest fixes..opencode/commands/review.md
---
description: Review recent changes
---
Recent commits:
!`git log --oneline -10`
Changed files:
!`git diff --name-only HEAD~5`
Review these changes for:
- Code quality issues
- Performance concerns
- Security vulnerabilities.opencode/commands/component.md
---
description: Create React component
---
Create a new React component named $1:
- Location: src/components/$1.tsx
- Include TypeScript types
- Add basic props interface
- Follow project conventions from @src/components/Example.tsx/component Button.opencode/commands/deploy.md
---
description: Deploy to environment
agent: build
subtask: true
---
Deploy to $1 environment:
!`git status`
Steps:
1. Run pre-deployment checks
2. Build production bundle
3. Deploy to $1
4. Verify deployment/deploy staging.opencode/commands/doc.md
---
description: Generate documentation
---
Generate documentation for $ARGUMENTS:
Code to document:
@$ARGUMENTS
Create comprehensive documentation including:
- Function/class description
- Parameters and return values
- Usage examples
- Edge cases/doc src/utils/parser.ts/init/undo/redo/share/helpmodel:agent:opencode.jsonexamples/test-command.mdcomponent-command.mdreview-command.mddeploy-command.md.opencode/commands/~/.config/opencode/commands/.md$ARGUMENTS$1$2/command arg1 arg2bash -c "your command"ls path/to/filereferences/template-syntax.mdreferences/configuration-options.mdreferences/common-patterns.mdexamples/test-command.mdcomponent-command.mdreview-command.mddeploy-command.md
---
description: Brief description
agent: agent-name
subtask: true
---
Template content with $ARGUMENTS or $1, $2
Include shell output: !`command`
Include files: @path/to/file{
"command": {
"name": {
"template": "Prompt text",
"description": "Brief description",
"agent": "agent-name",
"model": "model-name",
"subtask": true
}
}
}$ARGUMENTS$1$2$3command@path/to/file