openeditor-project-setup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenEditor Project Setup

OpenEditor 项目配置

Quick Start

快速开始

Use this skill to onboard an arbitrary repo into OpenEditor. The output is usually:
  • .logic-editor.json
  • oe-swift.json
    for iOS or SwiftUI repos
  • a short explanation of what was inferred vs. what still needs confirmation
When the repo signals are sufficient, generate the file contents directly. Do not ask the user for the
.logic-editor.json
or
oe-swift.json
schema when the references in this skill already cover it.
Read only the references you need:
  • Always read references/project-config.md
  • Read references/project-detection.md when inferring framework, port, or run command
  • Read references/ios-config.md only for iOS or SwiftUI projects
使用此技能将任意代码仓库接入OpenEditor。输出内容通常包括:
  • .logic-editor.json
  • 针对iOS或SwiftUI仓库的
    oe-swift.json
  • 一份简短说明,解释已推断的内容和仍需确认的内容
当仓库提供的信号足够时,直接生成文件内容。 当本技能中的参考资料已涵盖相关内容时,不要向用户询问
.logic-editor.json
oe-swift.json
的 schema。
仅阅读你需要的参考资料:
  • 务必阅读references/project-config.md
  • 推断框架、端口或运行命令时,阅读references/project-detection.md
  • 仅针对iOS或SwiftUI项目阅读references/ios-config.md

Workflow

工作流程

1. Inspect the repo first

1. 先检查代码仓库

Look for the smallest high-signal set of inputs:
  • package.json
  • lockfiles such as
    bun.lockb
    ,
    bun.lock
    ,
    package-lock.json
    , or
    pnpm-lock.yaml
  • framework folders such as
    app/
    ,
    pages/
    ,
    src/
    ,
    templates/
    ,
    layout/
  • iOS signals such as
    *.xcodeproj
    ,
    *.xcworkspace
    , and
    *.swift
  • any existing
    .logic-editor.json
    or
    oe-swift.json
Do not invent support for frameworks that the references do not cover.
寻找最少量的高信号输入:
  • package.json
  • 锁文件,如
    bun.lockb
    bun.lock
    package-lock.json
    pnpm-lock.yaml
  • 框架文件夹,如
    app/
    pages/
    src/
    templates/
    layout/
  • iOS相关信号,如
    *.xcodeproj
    *.xcworkspace
    *.swift
  • 任何已存在的
    .logic-editor.json
    oe-swift.json
不要为参考资料未涵盖的框架添加支持。

2. Infer the project type conservatively

2. 保守地推断项目类型

Prefer the real parser defaults from the references over generic assumptions.
  • next
    -> port
    3000
    , run command
    npm run dev
    or
    bun dev
    when Bun lockfiles are present
  • astro
    -> port
    4321
  • expo
    -> port
    8081
    , run command
    npx expo start
  • react-native
    -> port
    8081
    , run command
    npm start
    or
    bun start
  • Vite React -> port
    5173
  • Shopify theme -> port
    9292
    , run command
    shopify theme dev
  • iOS -> port
    0
    , empty
    runCommand
    , plus
    oe-swift.json
  • Unknown web repo -> default to
    type: "unknown"
    , port
    5173
    , run command
    npm run dev
If the evidence is mixed, explain that uncertainty instead of pretending confidence.
优先使用参考资料中的实际解析器默认值,而非通用假设。
  • next
    -> 端口
    3000
    ,当存在Bun锁文件时运行命令为
    npm run dev
    bun dev
  • astro
    -> 端口
    4321
  • expo
    -> 端口
    8081
    ,运行命令
    npx expo start
  • react-native
    -> 端口
    8081
    ,运行命令
    npm start
    bun start
  • Vite React -> 端口
    5173
  • Shopify theme -> 端口
    9292
    ,运行命令
    shopify theme dev
  • iOS -> 端口
    0
    runCommand
    为空,同时生成
    oe-swift.json
  • 未知Web仓库 -> 默认
    type: "unknown"
    ,端口
    5173
    ,运行命令
    npm run dev
如果证据存在矛盾,要说明这种不确定性,而非假装确定。

3. Generate the smallest correct config

3. 生成最小化的正确配置

Rules:
  • Keep
    .logic-editor.json
    minimal unless the repo clearly supports more
  • Do not add speculative routes or URL-state variants just to look smart
  • If route discovery is weak, emit a single home route:
    • { "path": "/", "label": "Home" }
  • Preserve existing config when updating; merge carefully instead of replacing unrelated fields
  • Do not invent unsupported keys
规则:
  • 保持
    .logic-editor.json
    尽可能简洁,除非仓库明确支持更多配置
  • 不要为了显得专业而添加推测性的路由或URL状态变体
  • 如果路由发现的信号较弱,仅输出一个首页路由:
    • { "path": "/", "label": "Home" }
  • 更新时保留现有配置;仔细合并而非替换无关字段
  • 不要添加不支持的键

4. Only generate
oe-swift.json
for real iOS projects

4. 仅为真正的iOS项目生成
oe-swift.json

When the repo is SwiftUI or Xcode-based:
  • infer
    scheme
    from the
    .xcodeproj
    or
    .xcworkspace
    name when possible
  • default simulator to
    iPhone 16 Pro
  • infer views from obvious
    *View.swift
    files
  • keep view entries simple unless the repo provides stronger signals
  • do not fabricate bundle IDs, deep links, or accessibility tap metadata unless the repo exposes them
当仓库是SwiftUI或基于Xcode时:
  • 尽可能从
    .xcodeproj
    .xcworkspace
    名称推断
    scheme
  • 模拟器默认设置为
    iPhone 16 Pro
  • 从明显的
    *View.swift
    文件推断视图
  • 保持视图条目简洁,除非仓库提供更强的信号
  • 不要编造Bundle ID、深度链接或无障碍点击元数据,除非仓库已暴露这些信息

5. Explain assumptions explicitly

5. 明确解释假设

After the config output, include a short explanation covering:
  • detected framework or platform
  • chosen port and run command
  • whether routes were inferred or defaulted
  • whether
    oe-swift.json
    was generated and why
  • which fields should be manually confirmed
在配置输出后,添加一段简短说明,涵盖:
  • 检测到的框架或平台
  • 选择的端口和运行命令
  • 路由是推断的还是默认的
  • 是否生成了
    oe-swift.json
    及原因
  • 哪些字段需要手动确认

6. Prefer generation over schema questions

6. 优先生成而非询问schema

If the repo is a supported type and the references here cover the config format:
  • generate the file contents directly
  • use conservative defaults when some fields are weakly signaled
  • ask follow-up questions only when a missing field would make the config invalid or misleading
Do not stop with "I need the schema" for normal React, Next, Astro, Expo, React Native, Shopify, or iOS repos.
如果仓库是受支持的类型,且此处的参考资料已涵盖配置格式:
  • 直接生成文件内容
  • 当某些字段信号较弱时,使用保守的默认值
  • 仅当缺失的字段会导致配置无效或产生误导时,才提出后续问题
对于普通的React、Next、Astro、Expo、React Native、Shopify或iOS仓库,不要以“我需要schema”为由停止操作。

Output Rules

输出规则

When the user asks for file contents, prefer this structure:
text
.logic-editor.json
```json
{ ... }
oe-swift.json
json
{ ... }
Notes
  • ...

If the project is not iOS, omit `oe-swift.json`.

If there is already a config file, show the updated file content instead of a from-scratch template.
当用户要求提供文件内容时,优先使用以下结构:
text
.logic-editor.json
```json
{ ... }
oe-swift.json
json
{ ... }
Notes
  • ...

如果项目不是iOS项目,省略`oe-swift.json`。
如果已存在配置文件,显示更新后的文件内容而非从头开始的模板。