AgentSkillsCN

prompt-lab

为新功能生成产品需求文档(PRD)。适用于功能规划、新项目启动,或在被要求撰写 PRD 时使用。触发条件包括:create a prd、write prd for、plan this feature、requirements for、spec out。

SKILL.md
--- frontmatter
name: prompt-lab
description: Capture the session's initial user prompt, analyze its effectiveness, and generate an optimized version. Use when the user says "/prompt-lab", "capture my prompt", "optimize my prompt", "prompt lab", or wants to save and improve the prompt that kicked off the session. Produces PROMPT_LAB.md with the original prompt, analysis, and a refined version for reuse and learning.

Prompt Lab

Capture the original session prompt, analyze it, and generate an optimized version. Builds prompt engineering intuition over time.

Process

  1. Check for existing file — Read ./PROMPT_LAB.md if it exists. If found:

    • Preserve previous entries under a ## Previous Prompts heading
    • Add new entry as the primary (top) section with updated timestamp
  2. Identify the initial prompt — Find the user's first substantive message that defined the session's work. This is the raw prompt exactly as written.

  3. Analyze the prompt against these dimensions:

    • Clarity — Was the goal unambiguous?
    • Scope — Was the scope well-defined or open-ended?
    • Context provided — Did it give enough background?
    • Constraints — Were boundaries/requirements stated?
    • Actionability — Could Claude act immediately or needed clarification?
  4. Generate the optimized prompt — Rewrite incorporating:

    • Everything learned during the session
    • Context that had to be discovered/clarified mid-session
    • Specific file paths, module names, or technical details that emerged
    • Explicit scope boundaries
    • Skills to load
    • Clear success criteria
  5. Add coaching notes — Brief, specific tips about what made the difference between the original and optimized versions.

  6. Write PROMPT_LAB.md in the current working directory.

Output Format

markdown
# Prompt Lab

**Date:** {YYYY-MM-DD}
**Session:** {branch or topic}

---

## Original Prompt

> {Exact verbatim copy of the user's initial prompt, in a blockquote}

## Analysis

| Dimension     | Rating                                     | Notes                           |
| ------------- | ------------------------------------------ | ------------------------------- |
| Clarity       | {good/fair/vague}                          | {specific observation}          |
| Scope         | {focused/broad/undefined}                  | {specific observation}          |
| Context       | {sufficient/partial/missing}               | {what was missing}              |
| Constraints   | {explicit/implicit/none}                   | {what should have been stated}  |
| Actionability | {immediate/needed-clarification/ambiguous} | {what blocked immediate action} |

**What worked well:** {1-2 things the prompt did right}

**What cost time:** {things that required clarification or discovery mid-session}

## Optimized Prompt

> {The rewritten prompt — ready to copy-paste into a new session}
>
> {This should be self-contained: include context, constraints, relevant paths,
> skills to load, and clear success criteria. A new Claude session reading only
> this prompt should be able to start working immediately.}

## Prompt Tips

{2-4 bullet points — specific, actionable lessons from this prompt. Not generic advice.}

- {Tip grounded in what actually happened this session}
- {Tip about what context/constraint would have saved time}

---

_Generated by /prompt-lab — building prompt intuition one session at a time._

Rules

  • Verbatim original — Copy the exact original prompt, warts and all. No editing.
  • Honest analysis — If the prompt was great, say so. If it was vague, say that too. No flattery.
  • Optimized != longer — The best prompts are concise. Add specificity, not word count.
  • Session-specific tips — Generic prompt advice ("be specific") is useless. Ground every tip in what actually happened.
  • The optimized prompt must be self-contained — Someone should be able to paste it cold into a new session and get productive immediately.
  • Write to ./PROMPT_LAB.md unless the user specifies a different path