Text Code Edit logo

Text Code Edit

Organization
meitu
text-code-edit

使用 meitu-cli 对已有 React/TSX/JSX 源码做编辑修改,支持多轮迭代。当用户提到改代码、修改页面、调整样式、换颜色、加按钮、删组件、改布局、改刚才的代码时触发。

Overview

Publishermeitu
Repositorymeitu-skills
Skill nametext-code-edit
Stars
36
Forks
3
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by meitu on GitHub. Read the source before you install it.

Installation

Install the Text Code Edit AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/meitu/meitu-skills/tree/main/skills/text-code-edit
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/meitu/meitu-skills.git /tmp/meitu-skills
mkdir -p .claude/skills
cp -r /tmp/meitu-skills/skills/text-code-edit .claude/skills/text-code-edit
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Text Code Edit in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Text Code Edit on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Text Code Edit is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Text Code Edit(代码编辑)

Overview

对已有 React/TSX/JSX 源码做样式调整、组件修改、交互/布局调整;支持多轮迭代,可自动串联上下文中最近一次 text-code 生成的 code_url。不处理:从零生成(无已有源码)、非 React/HTML 框架、后端代码、像素级还原。

API Mapping

场景后端 API
React/TSX 源码编辑text_code_edit

model 映射:

  • auto(默认)/ 不传 → 按路由规则决策
  • pretzel_pro / pretzel_lite → 直接指定
  • 模型回退链:pretzel_pro → pretzel_lite

Dependencies

  • meitu-cli: >=2.0.6
  • 凭证:CONFIG AKSK → meitu tools update;EXEC AKSK → 跑命令(见根 CONFIG.md)
  • 环境变量:MEITU_OPENAPI_TOOL_TASK_MODE=command

Core Workflow

Preflight → Execute → Deliver

Preflight

  1. meitu --version ≥ 2.0.6
  2. meitu auth verify --json
  3. 确认 registry 含 text-code-edit
  4. 解析 output_dir:openclaw.yaml → ./output/;else → ~/.openclaw/workspace/visual/output/text-code-edit/
  5. 解析 source_code_url:
    • 用户提供 → 直接用
    • 用户未提供 + 上下文有最近生成的 code_url → 自动取上下文
    • 两者都无 → 提示"请提供源码链接"

Execute

触发信号 / 路由规则

场景判定关键词路由
修改已有源码改代码、调样式、加组件、删组件、换颜色、改布局text_code_edit
上下文有 code_url改刚才的代码自动取上下文 code_url
用户说"重新做一个 / 从头开始"--不属于本工具(走 text-code)
非 React/HTML 源码.py/.java 等返回"仅支持 React/HTML 代码修改"

参数定义

参数类型必填范围默认值说明
promptSTRING是----修改描述。缺失 → 追问
source_code_urlSTRING是----.tsx/.jsx 源码 URL。缺失时取上下文最近 code_url,仍无 → 追问
modelENUM否auto / pretzel_pro / pretzel_litepretzel_pro模型选择
image_listARRAY否--[]参考图片 URL 列表
video_listARRAY否--[]参考视频 URL 列表
prompt_nameSTRING否----系统提示词名称

工具调用

基础编辑:

bash
meitu text-code-edit \
  --skill_name skill_text-code-edit \
  --prompt "{modification_description}" \
  --source_code_url "{code_url}" \
  --json --download-dir {output_dir}

带参考图片 + 指定模型:

bash
meitu text-code-edit \
  --skill_name skill_text-code-edit \
  --prompt "{modification_description}" \
  --source_code_url "{code_url}" \
  --model pretzel_pro \
  --image_list "{ref_url}" \
  --json --download-dir {output_dir}

错误降级

场景处理方式
prompt 缺失提示"请描述你想修改的内容"
source_code_url 缺失 + 上下文有自动取上下文 code_url
source_code_url 缺失 + 上下文无提示"请提供源码链接"
model 非法值回退至 pretzel_pro
修改意图模糊提示用户明确修改内容
source_code_url 非 React/HTML返回"仅支持 React/HTML 代码修改"
source_code_url 无法访问重试 1 次 → 返回错误
超时沿 pretzel_pro → pretzel_lite 重试
代码不完整原模型重试 1 次
内容合规拦截直接返回合规提示

Deliver

解析 --json:

  • ok: true → downloaded_files[0].saved_path 为修改后 .tsx
  • 更新上下文 code_url 指向新版本,以便继续多轮迭代

落盘:mv {file} {output_dir}/{YYYY-MM-DD}_{descriptive-name}_v{n}.tsx

Output

  • 格式: .tsx / .jsx 修改后源码
  • 命名: {YYYY-MM-DD}_{descriptive-name}_v{n}.tsx
  • 位置: 项目 → ./output/;一次性 → ~/.openclaw/workspace/visual/output/text-code-edit/

基线 Task ID

见根目录 references/task-id-baseline.md 中 text-code-edit 条目。

Frequently asked questions

What does the Text Code Edit AI skill do?

使用 meitu-cli 对已有 React/TSX/JSX 源码做编辑修改,支持多轮迭代。当用户提到改代码、修改页面、调整样式、换颜色、加按钮、删组件、改布局、改刚才的代码时触发。

Why use Text Code Edit on TypingMind?

Because you install it once and use it with any model. Text Code Edit is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Text Code Edit in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/meitu/meitu-skills/tree/main/skills/text-code-edit. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Text Code Edit?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Text Code Edit?

As many as you like. As long as a model supports skills, you can use Text Code Edit with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Text Code Edit AI skill free?

Yes. It is published on GitHub by meitu under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇