ワンクリックで
opencode-refine
Iteratively test and refine prompts, skills, and agent configurations using opencode run
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Iteratively test and refine prompts, skills, and agent configurations using opencode run
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Keep a GitLab issue's native Status in sync with its merge requests, and start implementing an issue by assigning it to the current user and setting the active milestone. Use when asked to start work on an issue, update an issue's status as MRs progress, or track issue state through the dev/review/complete lifecycle.
Run commands in a temporary tmux pane with full interactive zsh environment (login shell, shims, PATH, aliases, TTY).
Hammerspoon macOS automation. Config in ~/.hammerspoon/. Modules: init.lua, spaces, sleepwake, urlrouter, httpserver, meetings, webcam. Keywords: hammerspoon, hs, lua, audiodevice, hotkey, caffeinate, httpserver, Stream Deck, Rectangle Pro, blueutil, AirPods, URL routing, webcam, uhubctl. Use when: editing ~/.hammerspoon/ files, debugging Hammerspoon modules, adding Hammerspoon features, checking Hammerspoon logs.
Use before any Git branch operation in this repo. SSOT for the branch naming convention (<username>/<issue-id>/<branch-name>) — load before creating a branch instead of guessing the name. Also provides helpers for finding a branch's parent, rebasing related branches, force-pushing feature branches, and understanding commit or diff structure across stacked Git branches.
Inspect GitLab local ClickHouse tables, schemas, ingestion paths, and data patterns. Use for CH table questions, DESCRIBE TABLE, schema/source-of-truth checks under db/click_house, ClickHouse ingestion debugging, and investigating aggregates, distributions, or anomalous data in the GitLab repo.
Use when list, inspect, and undo branch-specific GitLab database migrations. Use for checking which migrations were introduced by the current branch, rolling them back safely, and understanding migration state during local GitLab database work.
| name | opencode-refine |
| description | Iteratively test and refine prompts, skills, and agent configurations using opencode run |
| version | 1.0.0 |
| license | MIT |
| compatibility | opencode |
| metadata | {"audience":"general","workflow":"local"} |
Use opencode run as a fast feedback loop to test and refine prompts, system instructions, skills, and agent behavior — without starting interactive sessions.
opencode run '<prompt>'
Runs a single non-interactive agent session. The agent executes, prints its response, and exits. No TUI, no interactive approval.
Important: Make prompts self-contained and unambiguous. If the agent decides it needs to ask a clarifying question, opencode run will hang (see Known Limitations).
Prerequisite: Prompts that invoke shell commands (e.g. "run ls -al") require bash permission set to "allow" in your opencode.json. If set to "ask", they will be auto-rejected in non-interactive mode.
| Flag | Purpose |
|---|---|
-m <model> | Override model (e.g. -m gitlab/duo-chat-gpt-5-4-nano for fast/cheap iterations) |
--print-logs | Show debug logs on stderr (permission checks, plugin hooks, config resolution) |
-f <file> -- | Attach a file as context — requires -- separator before the prompt |
--format json | Machine-readable event stream for scripting |
--dir <path> | Run the session in a specific directory (inherits that directory's config) |
--continue | Continue the last session (multi-turn refinement) |
--session <id> | Continue a specific session by ID |
--title <name> | Give the session a human-readable name |
opencode run, observe the result, and iterate quickly--print-logs when the issue is config, permissions, or plugin loading--dir when you need to validate repo-specific config behaviorSee references/EXAMPLES.md for concrete commands and patterns.
See references/EXAMPLES.md for concrete examples covering system-prompt refinement, permissions, JSON output, and multi-turn refinement.
Event types:
| Type | Contains |
|---|---|
step_start | sessionID, messageID, partID |
text | Agent text response chunks |
tool_use | Tool name, input params, full output, exit code, duration |
step_finish | Stop reason, token counts (input/output/cache/reasoning), cost |
Agents can invoke opencode run inside opencode run via the bash tool:
opencode run 'use opencode run to test if date works: opencode run "run date and tell me the time"'
What happens:
opencode run is a subprocess called via the bash toolopencode.jsonGotcha: If the inner prompt triggers the question tool, the inner session will hang — and the outer session's bash tool will block waiting for it. Keep inner prompts self-contained.
# IMPORTANT: requires '--' separator before the prompt
opencode run -f /path/to/file.md -- 'summarize this file'
# Multiple files
opencode run -f file1.md -f file2.md -- 'compare these files'
Without the --, the CLI parser treats the prompt as a second file path and errors.
opencode run invocation reads fresh config.-m gitlab/duo-chat-gpt-5-4-nano when testing infrastructure (permissions, plugins). Switch to your primary model for testing prompt/tone quality.--print-logs writes to stderr, so you can 2>debug.log and still see the agent's response on stdout.echo "prompt" | opencode run works — useful for multi-line prompts or scripted input.See references/LIMITATIONS.md for the question-tool hang, permission caveats, and config file locations.