openwork-core

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Quick Usage (Already Configured)

快速使用(已配置完成)

Orientation

开发准则

  • Read
    AGENTS.md
    ,
    VISION.md
    ,
    PRINCIPLES.md
    ,
    PRODUCT.md
    , and
    ARCHITECTURE.md
    before changing behavior.
  • Ensure
    vendor/opencode
    exists for self-reference.
  • Use the
    tauri-solidjs
    skill for stack-specific guidance.
  • 在修改功能行为前,请先阅读
    AGENTS.md
    VISION.md
    PRINCIPLES.md
    PRODUCT.md
    ARCHITECTURE.md
    文档。
  • 确保
    vendor/opencode
    目录存在,以便进行自引用。
  • 如需针对技术栈的特定指导,请使用
    tauri-solidjs
    技能。

Update the OpenCode mirror

更新OpenCode镜像

bash
git -C vendor/opencode pull --ff-only
bash
git -C vendor/opencode pull --ff-only

Development workflow

开发工作流

bash
pnpm tauri dev          # Desktop development
pnpm tauri ios dev      # iOS development
pnpm tauri android dev  # Android development
bash
pnpm tauri dev          # 桌面端开发
pnpm tauri ios dev      # iOS开发
pnpm tauri android dev  # Android开发

Or run directly in the desktop package:

或者直接在桌面端包中运行:

pnpm -C packages/desktop tauri dev
undefined
pnpm -C packages/desktop tauri dev
undefined

OpenCode Integration

OpenCode集成

Spawn OpenCode CLI

启动OpenCode CLI

bash
opencode -p "your prompt" -f json -q
bash
opencode -p "your prompt" -f json -q

Read OpenCode database

读取OpenCode数据库

~/.opencode/opencode.db  # SQLite database
~/.opencode/opencode.db  # SQLite数据库

Key tables

核心数据表

  • sessions
    — Task runs
  • messages
    — Chat messages and tool calls
  • history
    — File change tracking
  • sessions
    — 任务运行记录
  • messages
    — 聊天消息与工具调用记录
  • history
    — 文件变更追踪记录

Common Gotchas

常见注意事项

  • OpenWork must stay within OpenCode's tool surface; avoid inventing new capabilities.
  • Always expose plans, permissions, and progress for non-technical users.
  • Use Tauri commands for all system access (file, shell, database).
  • Keep UI at 60fps; avoid blocking the main thread.
  • Mobile builds require platform-specific setup (Xcode, Android Studio).
  • OpenWork必须在OpenCode的工具范围内运行;请勿新增未定义的功能。
  • 始终向非技术用户展示计划、权限和进度。
  • 所有系统访问(文件、Shell、数据库)均需使用Tauri命令。
  • 保持UI帧率为60fps;避免阻塞主线程。
  • 移动端构建需要特定平台的环境配置(Xcode、Android Studio)。

UI Principles

UI设计原则

  • Slick and fluid: animations, transitions, micro-interactions.
  • Mobile-first: touch targets, gestures, adaptive layouts.
  • Transparency: show plans, steps, and tool calls.
  • Progressive disclosure: hide advanced controls until needed.
  • 流畅顺滑:包含动画、过渡效果和微交互。
  • 移动端优先:适配触摸目标、手势和自适应布局。
  • 透明化:展示计划、步骤和工具调用过程。
  • 渐进式展示:高级控件仅在需要时显示。

First-Time Setup (If Not Configured)

首次配置(未完成配置时)

Clone the OpenCode mirror

克隆OpenCode镜像

bash
git clone https://github.com/anomalyco/opencode vendor/opencode
bash
git clone https://github.com/anomalyco/opencode vendor/opencode

Initialize Tauri project

初始化Tauri项目

bash
pnpm create tauri-app . --template solid-ts
bash
pnpm create tauri-app . --template solid-ts

Add mobile targets

添加移动端目标平台

bash
pnpm tauri ios init
pnpm tauri android init
bash
pnpm tauri ios init
pnpm tauri android init

Common Gotchas

常见注意事项

  • OpenWork must stay within OpenCode’s tool surface; avoid inventing new capabilities.
  • Always expose plans, permissions, and progress for non-technical users.
  • OpenWork必须在OpenCode的工具范围内运行;请勿新增未定义的功能。
  • 始终向非技术用户展示计划、权限和进度。

First-Time Setup (If Not Configured)

首次配置(未完成配置时)

Clone the OpenCode mirror

克隆OpenCode镜像

bash
git clone https://github.com/anomalyco/opencode vendor/opencode
bash
git clone https://github.com/anomalyco/opencode vendor/opencode