agentsclimarketplace

Opencode dev

Skill SoulChildTc/soulchild-skills/opencode-dev

我的个人 AI Skills 合集

Install
npx -y skills add SoulChildTc/soulchild-skills --skill opencode-dev

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Universal Open Code development skill. Use whenever the user asks to build, modify, debug, or understand any feature of the Open Code TUI (desktop or CLI). Covers session management, message streaming, permission approval, question dialogs, project management, provider/model config, SSE event handling, account/org management, MCP, VCS, file ops, and the full SDK/OpenAPI surface. ALSO use when the user asks about code structure, data flow, or how any part of Open Code works — this skill contains the complete "answer key" so you don't need to re-research. Trigger on phrases like "opencode feature", "TUI component", "build a session view", "approval flow", "SDK API", "opencode integration", "add a new API endpoint", "how does X work in opencode".

SKILL.md

4.8 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it

Open Code Dev Skill

Based on opencode v1.7.1

Architecture Overview

opencode/                  ← REFERENCE CODEBASE (https://github.com/opencode-ai/opencode)
├── packages/tui/src/     TUI core (Solid.js + @opentui)
├── packages/sdk/js/src/  SDK v1 + v2 clients
├── packages/server/src/  Express + Effect HttpApi server
└── packages/opencode/    CLI + core logic

Tech Stack

LayerTech
TUISolid.js + @opentui/solid + @opentui/core
Statesolid-js/store (createStore, produce, reconcile)
EventsSSE (Server-Sent Events) + local EventEmitter
HTTP Client@hey-api/openapi-ts generated client
ServerEffect HttpApi (declarative HTTP API framework)
SDK types@opencode-ai/sdk v1 in dist/gen/types.gen.d.ts
BuildTurborepo monorepo

Provider Tree (from outermost to innermost)

ExitProvider → EpilogueProvider → ErrorBoundary → TuiPathsProvider
→ TuiTerminalEnvironmentProvider → TuiStartupProvider → ClipboardProvider
→ OpencodeKeymapProvider → ArgsProvider → KVProvider → ToastProvider
→ RouteProvider → TuiConfigProvider → PluginRuntimeProvider
→ SDKProvider → ProjectProvider → SyncProvider (V1 events)
→ SyncProviderV2 (V2 events) → ThemeProvider → LocalProvider
→ PromptStashProvider → DialogProvider → FrecencyProvider
→ PromptHistoryProvider → PromptRefProvider → EditorContextProvider → <App />

1. Initialization Flow

Entry Point

packages/tui/src/app.tsxrun() (Effect function):

export const run = Effect.fn("Tui.run")(function* (input: TuiInput) {
  // input.url      — server base URL
  // input.args     — CLI args
  // input.config   — TuiConfig.Resolved
  // input.fetch    — custom fetch
  // input.headers  — custom headers
  // input.events   — EventSource
  // input.pluginHost — TuiPluginHost
})

Bootstrap (SyncProvider) — packages/tui/src/context/sync.tsx

Blocking (UI waits):

  • sdk.client.config.providers() → provider[]
  • sdk.client.provider.list() → provider_next
  • sdk.client.app.agents() → agent[]
  • sdk.client.config.get() → config
  • project.sync() → project info
  • If -c mode: session.list()

Non-blocking (background):

  • session.list(), command.list(), lsp.status(), mcp.status()
  • formatter.status(), session.status(), provider.auth(), vcs.get()

Status flow: "loading""partial""complete"

SDK Connection (SDKProvider) — packages/tui/src/context/sdk.tsx

  1. createOpencodeClient({ baseUrl }) creates HTTP client
  2. SSE starts via sdk.global.event() — infinite stream with exponential backoff reconnect (1s → 30s max)
  3. Events batched in 16ms window, then single batch() render

Module Loader

This skill is split into modular files for on-demand loading. Read the relevant file based on what the user needs:

If the user asks about...Load this file
Session data model, SDK methods, sync, status, routes, keyboard commandsSESSION.md
Message types, parts, tool state machine, tool→render mapping, V2 event streamSESSION.md
Permission approval flow, SDK reply, PermissionPrompt UIPERMISSION.md
Question dialog flow, SDK reply/reject, store structurePERMISSION.md
Project, provider & model types, auth (API key, OAuth)PROVIDER.md
Agent system, agent storePROVIDER.md
Sync store full structure, event update pattern, local storeSYNC.md
SSE event catalog (V1 + V2)SYNC.md
TUI control API (appendPrompt, showToast, etc.)API.md
File, Find, MCP, PTY, VCS, LSP SDK methodsAPI.md
Console, account, org managementAPI.md
OpenAPI endpoint referenceAPI.md
SDK client creation, request/response, structured output, error typesAPI.md
Key TUI file indexINDEX.md
Behavioral guidelines for implementationINDEX.md

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.