Logo Codex Draw

Codex Draw

Cộng đồng
simonmesmith
codex-draw

Launch and operate a local Codex drawing workspace: a lightweight vector board where the user and Codex share editable scene state through a browser UI, workspace-backed JSON, local API mutations, and SVG export. Use when the user wants to draw, edit, inspect, generate, refine, or export simple vector artifacts such as logos, icons, diagrams, badges, layout sketches, SVG assets, or visual scratchpad scenes.

Tổng quan

Nhà phát hànhsimonmesmith
Kho mãagent-skills
Tên kỹ năngcodex-draw
Sao
51
Bản fork
5
Tệp đi kèm
6
Giấy phépGPL-3.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 6 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được simonmesmith công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Codex Draw trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/simonmesmith/agent-skills/tree/main/skills/codex-draw
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/simonmesmith/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/codex-draw .claude/skills/codex-draw
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Codex Draw trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Codex Draw ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Codex Draw không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Codex Draw

Create and edit a local vector drawing board that both the user and Codex can modify. The browser UI is for visual editing; Codex should inspect and mutate the scene through the local API.

Start The Workspace

Run from the project or artifact workspace:

bash
python3 skills/codex-draw/scripts/codex_draw.py --workspace drawings

The server prints a local URL such as http://127.0.0.1:8765. Open that URL in the Codex preview or in-app browser when practical.

Useful options:

bash
python3 skills/codex-draw/scripts/codex_draw.py --workspace drawings --port 8787
python3 skills/codex-draw/scripts/codex_draw.py --workspace /path/to/workspace/drawings --scene codex-draw-scene-20260604-113000.json

When --scene is omitted, the server creates a new timestamped scene JSON in the workspace.

The workspace contains:

  • *.json: saved scene graphs; new drawings use timestamped names such as codex-draw-scene-20260604-113000.json
  • exports/*.svg: exported SVG files
  • assets/: user or generated image assets that can be inserted into scenes

Generated drawings/ workspaces are ignored by this repo by default.

Core Workflow

  1. Start the server and open the printed URL.
  2. Let the user draw or ask Codex to create objects.
  3. Use GET /api/scene before making agentic edits.
  4. For agent-created drawings, build in visible stages: add the title/background first, then major figures, then details and labels. Use short pauses or browser reloads between larger batches so the user can see the drawing come to life.
  5. Mutate the scene with object API calls, then re-read the scene if precision matters.
  6. Let the user choose an SVG destination with the UI export button, or use POST /api/export/svg-content when an agent needs raw SVG text.
  7. Return the active scene path and any important limitations.

Prefer API edits over browser-click automation. Only drive the UI directly when verifying visual behavior or when the user specifically asks.

Scene API

Replace {base} with the printed localhost URL.

bash
curl {base}/api/scene
curl -X POST {base}/api/objects -H 'Content-Type: application/json' -d '{"type":"rect","x":120,"y":90,"width":220,"height":120,"fill":"#ffffff","stroke":"#1a1c1f","strokeWidth":2}'
curl -X PATCH {base}/api/objects/rect-1 -H 'Content-Type: application/json' -d '{"fill":"#339cff"}'
curl -X DELETE {base}/api/objects/rect-1
curl -X POST {base}/api/selection -H 'Content-Type: application/json' -d '{"selection":["rect-1"]}'
curl -X POST {base}/api/export/svg-content

Available endpoints:

  • GET /api/scene: return full scene JSON.
  • POST /api/scene: replace the full scene.
  • POST /api/objects: create an object and assign an ID if missing.
  • PATCH /api/objects/:id: update an object.
  • DELETE /api/objects/:id: delete an object.
  • POST /api/objects/reorder: set object order with {"order":["id-a","id-b"]} from back to front.
  • GET /api/selection: return selected IDs and object data.
  • POST /api/selection: set selected IDs.
  • POST /api/save: force-save the active scene JSON.
  • POST /api/new: save the current scene, switch to a new timestamped scene JSON, and return the blank active scene.
  • POST /api/export/svg-content: return {"filename":"...svg","svg":"..."} without writing to the workspace.
  • POST /api/export/svg-save-as: open a native macOS save dialog and write the SVG to the user-selected path.
  • POST /api/export/svg: write an SVG to exports/ and return its path. Prefer the UI export button for user-facing downloads.

The UI autosaves after object changes and shows the active scene path plus the last save time in the top status line. It also polls scene state, so API mutations appear in the browser shortly after they are saved.

Scene Model

Scenes are JSON:

json
{
  "version": 1,
  "revision": 1,
  "canvas": {
    "width": 1200,
    "height": 800,
    "background": "#ffffff"
  },
  "objects": [],
  "selection": []
}

Object fields are intentionally explicit and human-readable:

  • Common: id, type, name, x, y, width, height, rotation, fill, stroke, strokeWidth, opacity, locked, visible, zIndex
  • rect: uses x, y, width, height
  • ellipse: uses x, y, width, height
  • line and arrow: use x, y, x2, y2
  • text: uses x, y, text, fontSize, fontFamily, fill
  • image: uses x, y, width, height, href

Keep coordinates in canvas pixels. Keep object order stable by setting zIndex values from back to front.

Visual Direction

Codex Draw should feel like a small Codex utility, not a generic SaaS tool. The app uses compact Codex theme variables with fallbacks:

  • --codex-base-accent
  • --codex-base-surface
  • --codex-base-ink

The UI should stay quiet: crisp borders, compact icon-like tool buttons, clear focus states, no landing page, no decorative gradients, and no marketing copy.

Validation

After editing this skill, run:

bash
python3 -m py_compile skills/codex-draw/scripts/codex_draw.py
python3 skills/codex-draw/scripts/codex_draw.py --workspace /tmp/codex-draw-test --port 8765

In another shell, verify:

bash
curl http://127.0.0.1:8765/api/scene
curl -X POST http://127.0.0.1:8765/api/objects -H 'Content-Type: application/json' -d '{"type":"ellipse","x":120,"y":90,"width":120,"height":120,"fill":"#339cff"}'
curl -X POST http://127.0.0.1:8765/api/export/svg-content

Open the URL in the Codex in-app browser when practical and confirm the canvas is visible, object creation works, API-created objects appear, the right panel scrolls independently for long object lists, and the UI export button lets the user choose a destination.

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Codex Draw làm được gì?

Launch and operate a local Codex drawing workspace: a lightweight vector board where the user and Codex share editable scene state through a browser UI, workspace-backed JSON, local API mutations, and SVG export. Use when the user wants to draw, edit, inspect, generate, refine, or export simple vector artifacts such as logos, icons, diagrams, badges, layout sketches, SVG assets, or visual scratchpad scenes.

Vì sao nên dùng Codex Draw trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Codex Draw là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Codex Draw trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/simonmesmith/agent-skills/tree/main/skills/codex-draw. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Codex Draw?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Codex Draw với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Codex Draw với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Codex Draw có miễn phí không?

Có. Kỹ năng này được simonmesmith phát hành trên GitHub theo giấy phép GPL-3.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇