Skill: keyzzzoe/prompt-transformer (version 1.0.1)

--- name: prompt-transformer description: Transform messages that begin with `@prt` or `@prompt` into structured, copy-ready prompts for coding, prototyping, planning, and other build-oriented tasks. Use when a user wants prompt-writing help, wants a natural-language request upgraded into a stronger prompt, wants a short summary of the prompt's key handling, or uses the `@prt` / `@prompt` prefix. Also use to bypass non-target prefixed inputs that are really ordinary chat, simple questions, or casual remarks. --- # Prompt Transformer Turn a plain-language request into a prompt the user can directly copy into another model. Keep it useful, compact, and practical. ## Canonical Trigger Treat this as the trigger pattern: ```regex ^\s*@(?:prt|prompt)(?:\s+|(?=[^A-Za-z\s]))(.+)?$ ``` Follow these rules: - Allow leading whitespace. - Support only `@prt` and `@prompt`. - Allow one or many spaces before the request body. - Also allow attached forms such as `@prt帮我写一篇论文` and `@prompt帮我做个原型`. - In attached form, do not treat ASCII letters immediately after the prefix as a valid trigger. This avoids false matches such as `@promptify`. - Do not trigger on inline mentions that do not start the message. - Trim the extracted request body before using it. If there is no meaningful body, return a short usage hint instead of generating a prompt. ## Workflow Decision Tree ### 1. Parse Extract the request body after the prefix. ### 2. Triage Choose exactly one path: - **Transform** when the request is for building, generating, designing, implementing, planning, or structuring something that benefits from a better prompt. - **Clarify** when key missing information would materially change the result. - **Bypass** when the prefixed text is really just a normal chat message, greeting, joke, weather question, or other simple Q&A. Read `references/decision-guide.md` when the choice is not obvious. ### 3. Generate or Respond - On **transform**: produce a clean prompt body plus a very short summary of the key prompt operations. - On **clarify**: ask only 1 to 3 high-value questions. - On **bypass**: answer naturally as ordinary chat. Do not output the prompt template. ## Prompt Construction Rules Build prompts that are easy to copy and use immediately. Use only the sections that improve the result. Depending on task complexity, include some of these: - role - context - goal - task breakdown - constraints - output format - acceptance criteria - edge cases - assumptions Apply these heuristics: - Keep simple tasks lean. - Make complex tasks explicit. - Preserve the user's language unless they ask otherwise. - Do not mix explanation inside the prompt body. - Do not pretend assumptions came from the user. Read `references/prompt-patterns.md` when you need a task-specific prompt shape. ## Information Sufficiency Rules Choose one of these three levels: 1. **Enough information** → generate the prompt directly. 2. **Minor gaps** → generate the prompt and list assumptions explicitly. 3. **Major gaps** → ask concise clarification questions first. Typical major gaps include unclear platform, unclear deliverable, unclear audience, unclear technical stack when it matters, or unclear scope for a large system request. ## Conversation Scope Guardrails Treat each `@prt` / `@prompt` request as a one-turn transformation. Follow these rules after a prompt has been generated: - The prefix applies only to the current user message. - The generated prompt is a deliverable, not the default topic for later non-prefixed messages. - Do not keep speaking in prompt-generation mode unless the user explicitly asks to continue refining that prompt. - Default to a clean stop after the prompt output; do not append a proactive multi-option menu unless the user explicitly asks for next-step choices. - If you add any closing line, keep it to one short sentence at most. - If the next non-prefixed user message is short and ambiguous, ask one brief clarification question instead of guessing. - When the surrounding context suggests the user is discussing the skill, testing behavior, versions, or optimization, prefer that meta-conversation over the topic inside the generated prompt. Example ambiguity guard: ```text 你是指继续优化这个 skill，还是继续优化刚刚生成的那条 Prompt？ ``` ## Output Contract ### A. Standard Prompt Output ```markdown 💡 **您的专属 Prompt 已生成，请审查：** [可直接复制使用的 Prompt 正文] --- 📝 **Prompt 关键处理：** - [处理 1] - [处理 2] ``` Use 2 bullets by default. Use 3 bullets only when the task is genuinely complex. Each bullet should be one short sentence that states what the prompt did in concrete terms, not why it did it. After this structure, stop by default. Do not automatically append numbered next-step choices such as `1 / 2 / 3` unless the user explicitly asks for options. ### B. Prompt Output with Assumptions ```markdown 💡 **您的专属 Prompt 已生成，请审查：** [可直接复制使用的 Prompt 正文] **已做如下假设：** - [假设 1] - [假设 2] --- 📝 **Prompt 关键处理：** - [处理 1] - [处理 2] ``` ### C. Clarification Output Ask for the minimum needed to proceed. Keep the questions concrete and high-impact. Clarification rules: - Ask only about information that is actually missing and materially changes the output. - Do not ask a second meta question unless the user's intent is genuinely ambiguous. - If one missing slot is enough to unblock the task, ask only that one. - For fragments such as `@prt帮我做一个`, first ask what the user wants to make; do not also ask whether they want a prompt or help refining the need. ### D. Bypass Output Reply in normal user-facing language. Bypass wording rules: - Default: reply directly, with no meta explanation. - For greetings or casual chat, just answer naturally. - If a short transition is helpful, keep it extremely short, for example: `这个我直接回你：` - Do not use internal words such as `旁路`. - Do not say `识别到` or `退出@prompt` unless the user explicitly asks about the mechanism. - Do not sound like a debugger explaining routing logic. For near-miss prefixes such as `@promptify...`, avoid saying `按规则不触发` or similar internal phrasing. Prefer short user-facing wording such as: - `如果你是想用这个功能，可以写成：@prompt 帮我写个页面` - `你如果是想让我帮你转 Prompt，可以直接写：@prompt帮我写个页面` ## Quality Bar The result should be: - directly usable - cleaner than the original request - appropriate to the task size - explicit about constraints when needed - short enough that the user will actually copy it - accompanied by a brief action-style summary that does not compete with the prompt body Avoid these failure modes: - over-engineering tiny requests - asking too many clarification questions - hiding important assumptions - treating every prefixed input as a prompt request - executing the task instead of generating the prompt ## V1 Boundary This skill generates prompts for review and reuse. It does not execute the generated task automatically. If the user asks to "execute" after generation, explain that V1 only creates the prompt and invite them to copy it or ask for a refined version. ## References - Read `references/decision-guide.md` for transform / clarify / bypass judgments. - Read `references/prompt-patterns.md` for recommended prompt shapes by task type. - Read `references/examples.md` for concrete input/output style examples.

path: references/debug-history.md
content: # Debug / Iteration History

This file is a human-readable release summary for the published skill page.

## Major fixes made before release

### 1. Post-generation topic stickiness
The skill originally treated the generated prompt as the default topic for later messages. This was fixed so prompt generation only applies to the current turn.

### 2. Overlong endings
The skill used to append extra next-step menus like `1 / 2 / 3`. This was removed so prompt output ends cleanly by default.

### 3. Explanation-heavy summaries
The output originally contained more teaching-style explanations. This was changed to a shorter `Prompt 关键处理` summary that says what the prompt did.

### 4. Bypass wording
Bypass replies used to sound like internal debugging language. This was changed to direct, user-facing wording.

### 5. Attached trigger support
The trigger was updated to support forms like `@prt帮我...` while still avoiding false matches such as `@promptify...`.

### 6. Clarification restraint
Clarification logic was tightened so the skill asks only the minimum missing question needed to proceed.

### 7. Execution-boundary blocker
A critical bug was found where a `@prt` request could accidentally be treated like a real execution request. This was promoted to a release blocker and fixed before release.

## Current release mindset

This skill is intended to be:
- practical
- lightweight
- user-facing
- safe in conversation
- clear about boundaries

## Update note

This skill will continue to be updated based on real usage and edge-case testing.

path: references/decision-guide.md
content: # Decision Guide

Use this guide when deciding whether to transform, clarify, or bypass.

## 1. Transform

Choose **transform** when the user wants a stronger prompt for a task that an AI could continue working on.

Common signals:
- 写一个脚本 / 页面 / 接口 / 工具
- 设计一个原型 / MVP / PRD 草稿
- 规划一个复杂任务或多步骤流程
- 需要特定输出格式、约束条件、角色或验收标准

Examples:
- `@prt 帮我写一个 Python 脚本，批量重命名文件`
- `@prompt 帮我设计一个面向独立开发者的 SaaS 登录页原型`
- `@prt 帮我整理一个 AI 自动运营工作流`

## 2. Clarify

Choose **clarify** when a missing detail would meaningfully change the prompt.

Ask only 1 to 3 questions.

But do not treat `1 to 3` as a target. Ask the fewest questions that unblock the task.

High-impact missing details often include:
- target platform: web / mobile / desktop / backend / script
- target deliverable: code / prototype / PRD / task plan
- user or audience: who it is for
- technical stack: only when the stack materially changes the solution
- scope: especially for broad requests such as admin systems or full products

Examples:
- `@prompt 帮我做一个电商后台`
- `@prt 帮我设计一个管理系统`
- `@prompt 帮我做一个 AI 产品`

## 3. Transform with Assumptions

Use assumptions when the gaps are modest and common defaults are reasonable.

Good assumption cases:
- the request is narrow enough that a default does not distort the result
- the user likely wants speed over interrogation
- the assumptions can be stated in 1 to 3 short bullets

Example:
- `@prt 帮我做一个记账 App`

Reasonable assumptions might be:
- 面向个人用户
- 移动端优先
- 核心功能包括记账、分类、统计

## 4. Bypass

Choose **bypass** when the prefix is present but the content is not really a prompt-writing task.

Typical bypass cases:
- greetings
- weather
- jokes
- casual remarks
- simple factual questions
- low-value requests that do not benefit from prompt engineering

Examples:
- `@prt 今天天气怎么样？`
- `@prt 哈哈`
- `@prompt 你是谁`

On bypass:
- answer naturally
- do not output the prompt template
- do not force prompt-logic explanations
- avoid internal terms like `旁路`
- prefer direct user-facing wording
- for greetings, usually just reply with the greeting itself
- if needed, use a very short bridge such as `这个我直接回你：`

## 5. Conflict Handling

If the user asks for mutually conflicting goals, do not quietly smooth it over.

Examples:
- "极简实现" and "企业级完整系统"
- "只要几十行" and "包含完整权限、审计、报表、工作流"

In these cases:
- point out the tension briefly
- ask the user which side to prioritize

## 6. Post-generation Follow-up Rule

After generating a prompt, reset back to normal conversation unless the user explicitly keeps working on that prompt.

Important rules:
- `@prt` / `@prompt` affects only that one user turn.
- Do not assume the generated prompt's subject becomes the next default topic.
- If a later non-prefixed reply such as `做2` or `继续优化` could refer to multiple things, ask one short clarification question.
- If recent context shows the user is testing or discussing the skill itself, prefer that interpretation over the content of the generated prompt.

Bad pattern:
- user tests the skill with a paper-search prompt
- assistant generates a good prompt
- user says `做2`
- assistant wrongly continues the paper topic instead of checking whether `2` refers to the earlier skill discussion

Preferred recovery:
- `你是指继续做 skill 优化，还是继续优化刚刚那条 Prompt？`

## 7. Post-output Restraint Rule

After a successful prompt transformation, do not eagerly append a long tail of suggestions, branching plans, or numbered menus.

Good behavior:
- end cleanly after the required output contract
- optionally add one short closing sentence if it truly helps
- wait for the user to decide the next step

Bad behavior:
- adding `1 / 2 / 3` options by default
- proposing multiple future paths when the user did not ask
- turning a finished prompt delivery into a new round of sales-like prompting

Reason:
- excessive endings create ambiguity for short follow-ups like `做2`
- they also make the interaction feel more verbose and less product-like

## 8. Simplicity Rule

Do not inflate a small request into a giant enterprise template.

If the task is simple:
- use fewer sections
- keep the prompt compact
- keep the logic notes short

If the task is large:
- use more structure
- surface constraints and acceptance criteria clearly


path: references/examples.md
content: # Prompt Transformer Examples

Use this file for concrete examples when choosing between transform, clarify, and bypass.

## 1. Transform Directly

### Example A: code generation

**Input**
```text
@prt 帮我写一个网页抓取的 Python 脚本，抓取新闻标题并保存成 CSV
```

**Also valid**
```text
@prt帮我写一个网页抓取的 Python 脚本，抓取新闻标题并保存成 CSV
```

**Not valid**
```text
@promptify帮我写一个网页抓取的 Python 脚本
```

**Preferred user-facing reply**
```text
如果你是想用这个功能，可以写成：@prompt帮我写一个网页抓取的 Python 脚本
```

**Preferred behavior**
- Transform directly
- Keep the prompt practical and not overly long
- Add 2 short `Prompt 关键处理` bullets by default

### Example B: prototype generation

**Input**
```text
@prompt 帮我设计一个面向独立开发者的 SaaS 登录页原型
```

**Preferred behavior**
- Transform directly
- Include role, goal, target audience, page sections, and expected output format


## 2. Transform with Assumptions

### Example C: moderate ambiguity

**Input**
```text
@prt 帮我做一个记账 App
```

**Preferred behavior**
- Generate a prompt only if the missing details can be reasonably defaulted
- State assumptions explicitly, for example:
  - 面向个人用户
  - 移动端优先
  - 核心功能包括记账、分类、统计

## 3. Clarify First

### Example D: critical ambiguity

**Input**
```text
@prompt 帮我做一个电商后台
```

**Preferred behavior**
- Ask 1 to 3 clarification questions first
- Focus on the details that most affect the output, such as platform, scope, and desired deliverable

### Example I: fragment only

**Input**
```text
@prt帮我做一个
```

**Preferred behavior**
- Ask only the single missing question that unblocks the task
- Good reply shape: `你想做一个什么？比如页面、App、脚本、方案、论文，还是原型？`
- Do not add an extra meta question about whether the user wants a prompt or wants help refining the need

## 4. Bypass

### Example E: ordinary question

**Input**
```text
@prt 今天天气怎么样？
```

**Preferred behavior**
- Do not output a transformed prompt
- Reply naturally as a normal question

### Example F: casual chat

**Input**
```text
@prt 哈哈
```

**Preferred behavior**
- Bypass naturally
- Do not explain prompt engineering unless necessary
- Prefer a direct human reply like `哈哈` or `哈哈，怎么啦？`

### Example H: greeting

**Input**
```text
@prt 哈喽
```

**Preferred behavior**
- Reply directly, for example: `哈喽`
- Do not say `这个例子应该走旁路`
- Do not expose internal routing language to the user

## 5. Empty Input

### Example G: prefix only

**Input**
```text
@prt
```

**Preferred behavior**
- Return short usage guidance
- Do not output an empty prompt

Suggested wording:

```markdown
请输入您要转化的需求，例如：

@prt 帮我写一个 Python 脚本，批量重命名文件
@prompt 帮我设计一个面向独立开发者的登录页原型
```

## 6. Output Tone

Prefer this tone:
- concise
- practical
- professional but not stiff
- educational in a lightweight way

Avoid:
- long lectures on prompt engineering
- excessive jargon
- overformatted templates for very small tasks


path: references/guide-en.md
content: # @prompt v1.0 (English Guide)

This OpenClaw skill turns plain-language requests into **clearer, copy-ready prompts** that are easier for AI systems to understand and execute.

## What does this skill do?

You start a message with:
- `@prt`
- `@prompt`

Then write your request in natural language. The skill rewrites it into a more structured prompt.

Good for:
- coding tasks
- prototypes
- product planning
- research-style information gathering
- multi-step task breakdown

## Basic usage

```text
@prt Help me write a Python script to rename files by date
@prompt Design a landing page prototype for indie developers
@prt Find recent management papers and suggest master's thesis topics
```

Supported trigger forms:
- `@prthelp...` style for non-ASCII attached text such as Chinese
- `@prt help...`
- `@prt    help...`

## How it behaves

The skill routes requests into 3 paths:

1. **Transform**
   - rewrites the request into a structured prompt

2. **Clarify**
   - asks the minimum missing question(s) when key information is not enough

3. **Bypass**
   - replies normally for greetings, weather, casual chat, or simple Q&A

## Key features

- supports `@prt` and `@prompt`
- supports attached trigger forms and spaced forms
- avoids false matches like `@promptify...`
- keeps simple tasks lightweight
- asks restrained clarification questions
- bypasses normal chat naturally
- stops cleanly after generating the prompt
- uses a short `Prompt 关键处理` summary instead of long explanations

## Output style

Default output includes:
- one copy-ready prompt
- one short summary section explaining what was done

It avoids:
- long prompt-engineering lectures
- internal routing jargon
- unnecessary option menus after generation

## Debug / iteration summary

This release mainly fixed:
- topic stickiness after prompt generation
- internal wording leaking into bypass replies
- overlong endings
- attached-trigger boundary issues
- over-questioning during clarification
- mistakenly treating `@prt` requests as real execution requests

For more detail, see:
- `debug-history.md`

## Install

```bash
clawhub install prompt-transformer --version 1.0.1
```

## Who is it for?

- people who are not good at writing prompts
- users who want better prompts for GPT / Claude / Gemini / Cursor / Claude Code
- anyone who wants to reduce trial-and-error with AI

## Note

This skill will continue to be updated.

If you find it useful, please consider giving it a **star** on ClawHub.

path: references/guide-zh.md
content: # @prompt v1.0 正式版（中文说明）

这是一个把自然语言需求转换成**更适合 AI 理解和执行的 Prompt** 的 OpenClaw Skill。

## 这个 Skill 是做什么的？

你只需要在消息前加上：
- `@prt`
- `@prompt`

然后输入你的白话需求，它会帮你把需求整理成一段更结构化、更可直接复制使用的 Prompt。

适合场景：
- 写代码
- 做原型
- 写产品方案
- 查资料 / 做研究型整理
- 复杂任务拆解

## 它怎么用？

### 基本写法

```text
@prt 帮我写一个 Python 脚本，批量重命名文件
@prompt 帮我设计一个面向独立开发者的登录页原型
@prt帮我查找近五年管理学论文，并给我硕士选题思路
```

支持：
- `@prt帮我...`
- `@prt 帮我...`
- `@prt    帮我...`

## 它会怎么工作？

这个 Skill 会根据输入自动分成三类处理：

1. **Transform**
   - 把你的需求转成结构化 Prompt

2. **Clarify**
   - 如果关键信息不够，就先追问最少的问题

3. **Bypass**
   - 如果只是打招呼、天气、闲聊，就直接正常回复

## 主要特性

- 支持 `@prt` / `@prompt`
- 支持无空格、单空格、多空格触发
- 会避免误判类似 `@promptify...` 这种相似前缀
- 简单任务不会过度包装
- 模糊任务会克制地澄清
- 普通问答会自然旁路
- 生成后默认收住，不乱开 1 / 2 / 3 分支
- `Prompt 关键处理` 默认只写 2 条，复杂任务最多 3 条

## 输出风格

默认输出：
- 一段可直接复制使用的 Prompt
- 一个简短的 `Prompt 关键处理` 摘要

不会再默认输出：
- 很长的提示词教学解释
- 内部路由术语
- 多余的系统腔说明

## 调试与迭代记录（摘要）

这个版本主要修过这些问题：
- 生成后话题粘连
- 旁路时暴露内部术语
- 结尾过长、主动给 1/2/3 选项
- `@prt帮我...` 附着触发边界
- 澄清问题问得太多
- 错把 `@prt` 请求当成真实执行请求

更详细记录见：
- `debug-history.md`

## 安装方式

```bash
clawhub install prompt-transformer --version 1.0.1
```

## 适合谁

- 不擅长写 Prompt 的普通用户
- 想把需求更清晰地交给 GPT / Claude / Gemini / Cursor / Claude Code 的用户
- 想减少 AI 来回试错成本的人

## 说明

这个 Skill 会持续更新。

如果它对你有帮助，欢迎在 ClawHub 页面给它点一个 **star**。

path: references/prompt-patterns.md
content: # Prompt Patterns

Use these patterns as flexible shapes, not rigid templates. Keep the output proportional to the task.

## 1. Simple Coding Task Pattern

Use for small scripts, utilities, or focused coding requests.

Recommended shape:
- role
- goal
- constraints
- output requirements

Example structure:

```text
你是一名经验丰富的 [语言/领域] 工程师。

目标：
[用户要完成的事]

约束条件：
- [技术约束]
- [环境约束]
- [依赖限制]

输出要求：
- 提供完整可运行代码
- 简要说明关键实现思路
- 若有潜在边界情况，一并说明
```

## 2. Prototype / Product Idea Pattern

Use for landing pages, SaaS prototypes, MVP ideas, and PRD-like requests.

Recommended shape:
- role
- target audience
- objective
- required modules or sections
- output format

Example structure:

```text
你现在是一位资深产品经理兼 UX 设计顾问。

背景：
[用户场景和目标用户]

目标：
[要设计的页面 / 原型 / MVP]

请完成以下任务：
1. 明确页面/产品核心目标
2. 拆解关键模块
3. 说明每个模块的作用
4. 给出建议的信息层级与交互重点

输出格式：
- 先给整体方案概述
- 再分模块说明
- 最后补充设计建议或注意事项
```

## 3. Complex Multi-step Task Pattern

Use for larger tasks that need structure, sequencing, and success criteria.

Recommended shape:
- role
- context
- goal
- task breakdown
- constraints
- acceptance criteria
- output format

Example structure:

```text
你是一位擅长系统设计与任务拆解的高级顾问。

背景：
[上下文]

目标：
[最终目标]

请按以下要求执行：
1. 先拆解任务阶段
2. 识别关键风险与依赖
3. 为每个阶段给出具体产出
4. 若存在多种可行路径，说明推荐方案及理由

约束条件：
- [限制 1]
- [限制 2]

验收标准：
- [成功标准 1]
- [成功标准 2]

输出格式：
- 使用清晰的小节
- 先总后分
- 最后给出建议的下一步行动
```

## 4. Assumptions Section Pattern

When using assumptions, keep them outside the prompt body in the assistant response.

Good pattern:

```markdown
**已做如下假设：**
- 面向个人用户
- Web 端优先
- 默认使用 Python 实现
```

## 5. Prompt Summary Pattern

Keep the summary minimal.

Default rule:
- use 2 bullets
- use 3 only for clearly complex tasks
- each bullet should be one short sentence
- say what the prompt did, not why it did it

Strong examples:
- 限定了时间范围。
- 限定了文献来源和真实性要求。
- 补了输出结构和选题建议模块。

Avoid:
- very long bullets
- textbook-style prompt theory
- phrases like `是为了`
- repeating obvious parts of the user's own request
- explaining every section of the prompt


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)