Spec Clarification
Overviewâ
Spec Clarification is Wegent's interactive requirement specification clarification mode that helps users refine vague requirements into clear development tasks through structured Q&A.
Quick Startâ
1. System Initializationâ
On first startup, the system automatically creates the following entities:
- spec-clarification-ghost: Requirement clarification system prompt
- spec-clarification-bot: Requirement clarification Bot
- spec-clarification-team: Requirement clarification Team
2. Select Team in Frontendâ
- Navigate to the Code page
- Select spec-clarification-team in the Team selector
- Enter a vague requirement, e.g., "I want to add a user login feature"
3. Interaction Flowâ
Step 1: Submit Initial Requirementâ
User input: "I want to add a login feature"
Step 2: Answer Clarification Questionsâ
The system will display 3-5 clarification questions, such as:
- Which login methods should be supported? (multiple choice)
- Do you need a "Remember Me" feature? (single choice)
- How should login failures be handled? (single choice)
Each question supports:
- Preset Options: Click radio/checkbox buttons
- Custom Input: Click "Custom Input" button to switch to text input mode
Step 3: Submit Answersâ
After filling in all questions, click the "Submit Answers" button.
Step 4: Get Final Promptâ
The system generates a refined requirement description based on your answers. You can:
- Copy Prompt: Click the "Copy Prompt" button
- Create New Task: Click "Create New Task with This Prompt" to directly create a Code task
Technical Architectureâ
Frontend Componentsâ
MessagesArea.tsx
âââ ClarificationForm.tsx # Clarification form container
â âââ ClarificationQuestion.tsx # Individual question renderer
âââ FinalPromptMessage.tsx # Final prompt display
Data Flowâ
Data Structuresâ
Important Update: Since 2025, the system has migrated from JSON format to Markdown format to improve readability and fault tolerance. Even if parsing fails, users can still see readable Markdown content.
Clarification Questions Format (Agent â Frontend)â
Agent outputs clarification questions in Markdown format:
## ðĪ éæąæūæļ
éŪéĒ (Clarification Questions)
### Q1: Which login methods should be supported?
**Type**: multiple_choice
**Options**:
- [â] `email` - Email/Password (recommended)
- [ ] `oauth` - OAuth (Google, GitHub, etc.)
- [ ] `phone` - Phone number + SMS verification
### Q2: Do you need a "Remember Me" feature?
**Type**: single_choice
**Options**:
- [â] `yes` - Yes (recommended)
- [ ] `no` - No
### Q3: Any other special requirements?
**Type**: text_input
Question Types:
single_choice: Single choice (Radio)multiple_choice: Multiple choice (Checkbox)text_input: Text input (TextArea)
Option Format:
[â]indicates recommended/default option, will be auto-selected[ ]indicates regular option- Backticks
`value`wrap technical values -followed by human-readable label text
User Answer Format (Frontend â Agent)â
Users submit answers in Markdown format:
## ð æįåį (My Answers)
### Q1: Which login methods should be supported?
**Answer**:
- `email` - Email/Password
- `oauth` - OAuth (Google, GitHub, etc.)
### Q2: Do you need a "Remember Me" feature?
**Answer**: `yes` - Yes
### Q3: Any other special requirements?
**Answer**: Login page needs to support dark mode
Final Prompt Format (Agent â Frontend)â
Agent outputs the final requirement prompt in Markdown format:
## â
æįŧéæąæįĪščŊ (Final Requirement Prompt)
Implement user login functionality with the following requirements:
**Authentication Methods**:
- Email/Password authentication (primary method)
- OAuth integration (support Google and GitHub)
**User Experience**:
- Include "Remember Me" checkbox to maintain login state
- Login page supports dark mode
**Security Requirements**:
- Use bcrypt or similar algorithm for password encryption
- Secure storage of OAuth tokens
- Implement rate limiting to prevent brute force attacks
Backward Compatibilityâ
The frontend supports parsing both Markdown format and legacy JSON format, ensuring backward compatibility. If the Agent still outputs JSON, the system will automatically recognize and handle it correctly.
Customizing Botsâ
Modifying system_promptâ
To adjust the style or logic of clarification questions, modify the systemPrompt of spec-clarification-ghost:
- Find "spec-clarification-ghost" in the settings page
- Edit the system_prompt
- Save changes
Creating New Requirement Clarification Botsâ
- Create a new Ghost, referencing the system_prompt structure of
spec-clarification-ghost - Create a new Bot, referencing the new Ghost
- Create a new Team, referencing the new Bot
- Select the new Team in the frontend
Best Practicesâ
Agent Side (Writing system_prompt)â
-
Question Design:
- 3-5 questions per round, avoid too many
- Use
[â]to mark recommended options and guide users - Prioritize multiple choice questions to reduce user input cost
-
Output Specification:
- Strictly output Markdown using specified heading formats
- Use
## ðĪ éæąæūæļ éŪéĒheading for questions - Use
## â æįŧéæąæįĪščŊheading for final prompt - Don't add extra explanatory text outside Markdown structure
- Use simple identifiers for
question_id(e.g., q1, q2)
-
Follow-up Strategy:
- Determine if further clarification is needed based on answers
- Don't ask infinitely, generate final Prompt after 3-5 rounds
- Final Prompt should be detailed and actionable
Frontend Usageâ
-
Choose Appropriate Team:
- Requirement clarification phase: Select
spec-clarification-team - Code generation phase: Switch to
dev-team
- Requirement clarification phase: Select
-
Answering Tips:
- Prioritize recommended options unless you have special needs
- Use "Custom Input" to supplement details
- Ensure all questions are answered before submitting
-
Using Final Prompt:
- Copy Prompt for use in other tools
- Create new task directly for seamless transition to development workflow
Troubleshootingâ
Issue 1: Clarification Questions Not Displayingâ
Possible Causes:
- Agent didn't output properly formatted Markdown
- Markdown heading is not
## ðĪ éæąæūæļ éŪéĒor## ðĪ Clarification Questions
Solutions:
- Check Agent's system_prompt to ensure correct Markdown headings are used
- Check browser console for parsing errors
- Even if parsing fails, Markdown content should still be readable
Issue 2: No Response After Submitting Answersâ
Possible Causes:
- Network issues
- Agent error while processing answers
Solutions:
- Refresh page and try again
- Check backend logs
Issue 3: Final Prompt Has No Special Stylingâ
Possible Causes:
- Agent's Markdown heading is not
## â æįŧéæąæįĪščŊor## â Final Requirement Prompt
Solutions:
- Confirm Agent system_prompt has correct final output format
- Check if emoji icons are correct (ðĪ and â )
Future Enhancementsâ
- Support dependencies between questions (e.g., show q2 based on q1 answer)
- Support more question types (date picker, number input, file upload, etc.)
- Add clarification history for viewing and reusing previous results
- Support exporting clarification process as documentation