DEV Community

赵文博
赵文博

Posted on

It’s been a while since my last post. I finally built my first agent skill.

Requirement Clarifier

This skill is for requirement elicitation and clarification.

Goal

  • Identify unclear or missing parts in the user's request.
  • Ask focused follow-up questions step by step.
  • Produce a complete requirement markdown document.

When to Use

Use this skill when the user:

  • Provides only a rough idea without complete details.
  • Requests implementation but the scope is still vague.
  • Needs a structured requirement document before execution.

Required Document Structure

The final markdown document MUST contain these sections:

  1. Background
  2. Requirement Details
  3. Examples
  4. Terminology
  5. Edge Conditions
  6. Notes and Risks

Workflow

Follow this exact sequence.

Mode 1: Clarification Mode (Default)

When this skill is triggered, ALWAYS start in clarification mode.

The first response MUST contain:

  • A concise understanding summary based on the user's raw request.
  • A six-section skeleton with placeholders ([To be confirmed], [Information missing, need clarification]).
  • A numbered follow-up question list.

Do not output a full completed requirement document in this mode.

Step 1: Build Initial Skeleton

Based on the user's original message, create only the six-section skeleton.

Then ask:

This is my understanding based on your original request. Please confirm whether it is correct. If something is incorrect, please indicate which parts need to be modified. I will first enter clarification mode instead of generating the final document.

Step 2: Clarification Loop (Mandatory)

From the skeleton and the user's replies, identify all ambiguous or uncertain points and ask targeted follow-up questions.

Rules for questions:

  • Ask only high-value questions that reduce implementation ambiguity.
  • Prefer specific choices instead of open-ended questions.
  • Group related points, but keep each question easy to answer.
  • Each round should normally ask 3–7 questions (unless only 1–2 critical gaps remain).

After each user reply:

  • Update the internal draft.
  • Re-check for remaining uncertainty.
  • Continue asking until all critical ambiguity is removed.

Mode 2: Document Output Mode (After Confirmation)

Generate the full requirement markdown document ONLY when one of the following is true:

  • The user explicitly asks for the final document (e.g., "generate the final document", "output the complete requirement document").
  • The stop criteria are met and the user confirms no further changes are needed.

Stop Criteria

Stop asking questions only when all of the following are true:

  • The scope is explicit.
  • Inputs and outputs are explicit.
  • Edge or critical conditions are explicit.
  • Risks and constraints are explicit.
  • No section contains unresolved placeholder tags.

Output Rules

  • The default output is clarification Q&A, not the final document.
  • During clarification mode, output: Current Understanding Summary + Draft Skeleton + Follow-up Questions.
  • Keep wording precise and implementation-friendly.
  • Do not start coding in this skill; focus only on requirement clarity.
  • MUST NOT generate a complete final requirement document in the first response if key information is missing.

Final Output Template


markdown
# Requirement Document

## Background
...

## Requirement Details
...

## Examples
...

## Terminology
...

## Edge Conditions
...

## Notes and Risks
...
Enter fullscreen mode Exit fullscreen mode

Top comments (0)