

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Skills
incomplete
2: Writing Skills
incomplete
3: Skills Are Tools
incomplete
4: Skill Permissions
incomplete
5: Composable Skills
incomplete
6: Skill, Tool, or Agent?
incomplete
7: Custom Commands
incomplete
8: Dynamic Prompts
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
OpenCode's command pipeline supports a few useful prompt features:
$1, $2, and $ARGUMENTS!`bun test` These are command features. Invoking a skill with @skill-id activates the skill body without parsing command arguments or shell blocks (but it's still valid to invoke a skill and provide additional instructions in the same prompt).
For example, a file at .opencode/commands/linusfunc.md could contain:
---
description: Builds a function like Linus Torvalds would
---
Write a new function, complete with tests the way Linus Torvalds would. The function is $ARGUMENTS
The $ARGUMENTS variable is replaced by whatever you type after the command:
/linusfunc a sum function that adds two numbers together
You can also break the arguments into separate positional variables if you like:
The function is $1
It should $2 include tests
/linusfunc sum not
Which produces this prompt:
The function is sum
It should not include tests
While using @path-to-file works in the OpenCode prompt box to select a file and include its contents, it doesn't work in a command prompt: it just stays plain text. Instead, just tell the agent to read the file:
Read `src/asteroid.py`, then make me a new asteroid with jaggier edges.
With the playground still running, tell OpenCode to run and submit the CLI tests from the project root.