Coding Backend Opencodeのロゴ

Coding Backend Opencode

コミュニティ
ahmadrosid
coding-backend-opencode

Runtime prompt layer for OpenCode coding agent runs.

概要

公開者ahmadrosid
リポジトリnakama
スキル名coding-backend-opencode
スター
492
フォーク
91
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    ahmadrosidがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルCoding Backend OpencodeをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/ahmadrosid/nakama/tree/main/packages/core/src/skills/bundled/coding-backend-opencode
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ahmadrosid/nakama.git /tmp/nakama
mkdir -p .claude/skills
cp -r /tmp/nakama/packages/core/src/skills/bundled/coding-backend-opencode .claude/skills/coding-backend-opencode
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでCoding Backend Opencodeを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にCoding Backend Opencodeを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Coding Backend Opencodeは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

You are preparing a coding agent run for OpenCode, a provider-agnostic, open-source AI coding agent with a TUI and CLI. Use it as an autonomous coding worker orchestrated via terminal/process tools.

When to Use

  • The user explicitly asks to use OpenCode.
  • You want an external coding agent to implement, refactor, or review code.
  • You need long-running coding sessions with progress checks.
  • You want parallel task execution in isolated workdirs/worktrees.

Prerequisites

  • OpenCode installed: npm i -g opencode-ai@latest or brew install anomalyco/tap/opencode.
  • Auth configured: opencode auth login or provider env vars (e.g. OPENROUTER_API_KEY).
  • Verify readiness: opencode auth list should show at least one provider.
  • A git repository for code tasks (recommended).
  • pty=true for interactive TUI sessions.

Binary Resolution

Shell environments may resolve different OpenCode binaries. If behavior differs between your terminal and the agent, check:

which -a opencode
opencode --version

If needed, pin an explicit binary path, e.g. $HOME/.opencode/bin/opencode run '...'.

One-Shot Tasks

Prefer opencode run for bounded, non-interactive tasks (no pty needed):

opencode run 'Add retry logic to API calls and update tests'

Attach context files with -f:

opencode run 'Review this config for security issues' -f config.yaml -f .env.example

Show model thinking with --thinking, or force a specific model with --model provider/model.

Interactive Sessions (Background)

For iterative work requiring multiple exchanges, start the TUI in the background:

opencode   # with background=true, pty=true — returns a session id

Then send prompts and monitor progress via process actions (submit, poll, log). Send follow-up input with submit, and exit cleanly with Ctrl+C (\x03) or kill the process.

Important: Do NOT use /exit — it is not a valid OpenCode command and opens an agent selector dialog instead. Use Ctrl+C or kill to exit.

TUI Keybindings

KeyAction
EnterSubmit message (press twice if needed)
TabSwitch between agents (build/plan)
Ctrl+POpen command palette
Ctrl+X LSwitch session
Ctrl+X MSwitch model
Ctrl+X NNew session
Ctrl+X EOpen editor
Ctrl+CExit OpenCode

Resuming Sessions

After exiting, OpenCode prints a session ID. Resume with opencode -c (continue last) or opencode -s ses_abc123 (specific session).

Common Flags

FlagUse
run 'prompt'One-shot execution and exit
--continue / -cContinue the last OpenCode session
--session <id> / -sContinue a specific session
--agent <name>Choose OpenCode agent (build or plan)
--model provider/modelForce specific model
--format jsonMachine-readable output/events
--file <path> / -fAttach file(s) to the message
--thinkingShow model thinking blocks
--variant <level>Reasoning effort (high, max, minimal)
--title <name>Name the session

Procedure

  1. Verify tool readiness: opencode --version and opencode auth list.
  2. For bounded tasks, use opencode run '...' (no pty needed).
  3. For iterative tasks, start opencode with background=true, pty=true.
  4. Monitor long tasks with poll / log.
  5. If OpenCode asks for input, respond via submit.
  6. Exit with Ctrl+C (\x03) or kill — never /exit.
  7. Summarize file changes, test results, and next steps back to the user.

PR Review Workflow

OpenCode has a built-in PR command:

opencode pr 42

Or review in a temporary clone for isolation: clone the repo, then opencode run 'Review this PR vs main. Report bugs, security risks, test gaps, and style issues.' with the changed files attached via -f.

Parallel Work Pattern

Use separate workdirs/worktrees to avoid collisions — one OpenCode session per workdir, run in the background.

Session & Cost Management

List past sessions with opencode session list. Check token usage and opencode stats (optionally --days 7 --models anthropic/claude-sonnet-4).

Pitfalls

  • Interactive opencode (TUI) sessions require pty=true. opencode run does NOT need pty.
  • /exit is NOT a valid command — it opens an agent selector. Use Ctrl+C to exit the TUI.
  • PATH mismatch can select the wrong OpenCode binary/model config.
  • If OpenCode appears stuck, inspect logs before killing.
  • Avoid sharing one working directory across parallel OpenCode sessions.
  • Enter may need to be pressed twice to submit in the TUI.

Verification

Smoke test:

opencode run 'Respond with exactly: OPENCODE_SMOKE_OK'

Success criteria: output includes OPENCODE_SMOKE_OK, command exits without provider/model errors, and for code tasks the expected files change and tests pass.

Rules

  1. Prefer opencode run for one-shot automation — simpler, no pty.
  2. Use interactive background mode only when iteration is needed.
  3. Always scope OpenCode sessions to a single repo/workdir.
  4. For long tasks, provide progress updates from process logs.
  5. Report concrete outcomes (files changed, tests, remaining risks).
  6. Exit interactive sessions with Ctrl+C or kill, never /exit.

Prompt Preparation Checklist

When preparing the coding agent instruction for OpenCode:

  • State the desired code outcome clearly and concretely.
  • Tell OpenCode to inspect the repository context before editing files.
  • Include any file, behavior, or test hints that reduce ambiguity.
  • Prefer precise change requests over broad open-ended prompts.
  • Ask for a compact final report: changes made, validation run, remaining concerns.

よくある質問

AIスキル「Coding Backend Opencode」では何ができますか?

Runtime prompt layer for OpenCode coding agent runs.

TypingMindでCoding Backend Opencodeを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Coding Backend Opencodeはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにCoding Backend Opencodeをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/ahmadrosid/nakama/tree/main/packages/core/src/skills/bundled/coding-backend-opencodeを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Coding Backend Opencodeを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Coding Backend Opencodeは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもCoding Backend Opencodeを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Coding Backend Opencode」は無料ですか?

はい。ahmadrosidがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇