Fix #17: Convert requirements-clarity to correct plugin directory format

- Restructured from .claude/plugins/ to requirements-clarity/.claude-plugin/
- Plugin metadata in marketplace.json (not claude.json)
- Commands in requirements-clarity/commands/clarif.md
- Agent in requirements-clarity/agents/clarif-agent.md
- All prompts in English
- Updated root .claude-plugin/marketplace.json to register plugin
- Removed duplicate files from development-essentials
- Removed old .claude/plugins/requirements-clarity directory

Plugin now follows correct Claude Code plugin directory structure.

Generated by swe-agent
This commit is contained in:
swe-agent[bot]
2025-10-21 02:42:29 +00:00
parent 4d3789d0dc
commit 6b06403014
8 changed files with 140 additions and 750 deletions

View File

@@ -0,0 +1,29 @@
{
"name": "requirements-clarity",
"source": "./",
"description": "Transforms vague requirements into actionable PRDs through systematic clarification with 100-point scoring system",
"version": "1.0.0",
"author": {
"name": "Claude Code Dev Workflows",
"url": "https://github.com/cexll/myclaude"
},
"homepage": "https://github.com/cexll/myclaude",
"repository": "https://github.com/cexll/myclaude",
"license": "MIT",
"keywords": [
"requirements",
"clarification",
"prd",
"specifications",
"quality-gates",
"requirements-engineering"
],
"category": "essentials",
"strict": false,
"commands": [
"./commands/clarif.md"
],
"agents": [
"./agents/clarif-agent.md"
]
}

View File

@@ -0,0 +1,234 @@
# Requirements Clarity Plugin
## Overview
This Claude Code plugin automatically detects vague requirements and transforms them into crystal-clear Product Requirements Documents (PRDs) through systematic clarification.
## Installation
```bash
/plugin install requirements-clarity
```
Or add to your `.clauderc`:
```json
{
"plugins": {
"requirements-clarity": {
"enabled": true
}
}
}
```
## How It Works
### Automatic Activation
The plugin activates when Claude detects:
1. **Vague Feature Requests**
```
User: "add login feature"
User: "implement payment system"
User: "create user dashboard"
```
2. **Missing Technical Details**
- No technology stack mentioned
- No architecture or constraints specified
- No integration points identified
3. **Incomplete Specifications**
- No acceptance criteria
- No success metrics
- No edge cases or error handling
4. **Ambiguous Scope**
- Unclear boundaries ("user management" - what exactly?)
- No distinction between MVP and future features
### Clarification Process
```
User: "I want to implement a user login feature"
Claude detects vague requirement
Auto-activates requirements-clarity agent
Initial assessment: 35/100 clarity score
Round 1: Ask 2-3 targeted questions
User responds
Score update: 35 → 72
Round 2: Continue clarifying gaps
User responds
Score update: 72 → 93 ✓ (≥90 threshold)
Generate PRD files:
- ./.claude/specs/user-login/prd.md
- ./.claude/specs/user-login/clarification-log.md
```
## Scoring System (100 points)
| Dimension | Points | Criteria |
|-----------|--------|----------|
| **Functional Clarity** | 30 | Clear inputs/outputs (10), User interaction (10), Success criteria (10) |
| **Technical Specificity** | 25 | Tech stack (8), Integration points (8), Constraints (9) |
| **Implementation Completeness** | 25 | Edge cases (8), Error handling (9), Data validation (8) |
| **Business Context** | 20 | Problem statement (7), Target users (7), Success metrics (6) |
**Threshold**: ≥ 90 points required before PRD generation
## Output Structure
### 1. Clarification Log
`./.claude/specs/{feature-name}/clarification-log.md`
Documents the entire clarification conversation:
- Original requirement
- Each round of questions and answers
- Score progression
- Final assessment breakdown
### 2. Product Requirements Document
`./.claude/specs/{feature-name}/prd.md`
Structured PRD with four main sections:
#### Requirements Description
- Background: Business problem, target users, value proposition
- Feature Overview: Core functionality, boundaries, user scenarios
- Detailed Requirements: Inputs/outputs, interactions, data, edge cases
#### Design Decisions
- Technical Approach: Architecture, components, data storage, APIs
- Constraints: Performance, compatibility, security, scalability
- Risk Assessment: Technical, dependency, timeline risks
#### Acceptance Criteria
- Functional: Checklistable feature requirements
- Quality Standards: Code quality, testing, performance, security
- User Acceptance: UX, documentation, training
#### Execution Phases
- Phase 1: Preparation - Environment setup
- Phase 2: Core Development - Core implementation
- Phase 3: Integration & Testing - QA
- Phase 4: Deployment - Release
## Testing Guide
### Test Case 1: Vague Login Feature
**Input**:
```
"I want to implement a user login feature"
```
**Expected Behavior**:
1. Claude detects vague requirement
2. Shows initial score (~30-40/100)
3. Asks 2-3 questions about:
- Login method (username+password, phone+OTP, OAuth?)
- Functional scope (remember me, forgot password?)
- Technology stack (backend language, database, auth method?)
**Expected Output**:
- Score improves to ~70+ after round 1
- Additional questions about security, error handling, performance
- Final score ≥ 90
- PRD generated in `./.claude/specs/user-login/`
### Test Case 2: Ambiguous E-commerce Feature
**Input**:
```
"add shopping cart to the website"
```
**Expected Behavior**:
1. Auto-activation (no tech stack, no UX details, no constraints)
2. Questions about:
- Cart behavior (guest checkout? save for later? quantity limits?)
- User experience (inline cart vs dedicated page?)
- Backend integration (existing inventory system? payment gateway?)
- Data persistence (session storage, database, local storage?)
**Expected Output**:
- Iterative clarification (2-3 rounds)
- Score progression: ~25 → ~65 → ~92
- PRD with concrete shopping cart specifications
### Test Case 3: Clear Requirement (Should NOT Activate)
**Input**:
```
"Fix the null pointer exception in auth.go line 45 by adding a nil check before accessing user.Email"
```
**Expected Behavior**:
- Agent does NOT activate (requirement is already clear)
- Claude proceeds directly to implementation
## Benefits
1. **Proactive Quality Gate**: Prevents unclear specs from proceeding to implementation
2. **Zero Friction**: Users describe features naturally, no command syntax needed
3. **Context Awareness**: Claude recognizes ambiguity patterns automatically
4. **Persistent Mode**: Stays active throughout clarification conversation
## Command Alternative
For manual invocation, use:
```
/clarif <your requirement description>
```
## Troubleshooting
### Plugin Not Activating
**Problem**: Claude doesn't enter clarification mode for vague requirements
**Solutions**:
1. Verify plugin is installed: `/plugin list`
2. Check plugin is enabled in `.clauderc`
3. Ensure agent and command files exist in plugin directory
4. Try more explicit vague requirement: "add user feature"
### Premature PRD Generation
**Problem**: PRD generated before score reaches 90
**Solution**: This is a bug - agent instructions explicitly require ≥90 threshold. Review the clarification log to see actual score.
## References
- **Claude Code Plugins Documentation**: https://docs.claude.com/en/docs/claude-code/plugins
- **Article**: https://github.com/stellarlinkco/articles/blob/master/deep-agents-zh.md
## Changelog
### v1.0.0 (2025-10-21)
- Created plugin in correct `.claude-plugin/` directory format
- Added `marketplace.json` plugin metadata
- Commands in `commands/clarif.md`
- Agent in `agents/clarif-agent.md`
- All prompts in English
- Maintained 100-point scoring system and PRD structure
- Compatible with Claude Code plugin system
---
**License**: MIT
**Author**: Claude Code Dev Workflows
**Homepage**: https://github.com/cexll/myclaude

View File

@@ -0,0 +1,361 @@
# Requirements Clarity Agent
## Agent Identity
You are the **Requirements Clarity Agent**, responsible for transforming vague requirements into actionable PRDs through systematic clarification.
## When to Activate
Auto-activate when you detect:
1. **Vague Feature Requests**
- User says: "add login feature", "implement payment", "create dashboard"
- Missing: How, with what technology, what constraints?
2. **Missing Technical Context**
- No technology stack mentioned
- No integration points identified
- No performance/security constraints
3. **Incomplete Specifications**
- No acceptance criteria
- No success metrics
- No edge cases considered
- No error handling mentioned
4. **Ambiguous Scope**
- Unclear boundaries ("user management" - what exactly?)
- No distinction between MVP and future enhancements
- Missing "what's NOT included"
## Core Principles
1. **Systematic Questioning**
- Ask focused, specific questions
- One category at a time (2-3 questions per round)
- Build on previous answers
- Avoid overwhelming users
2. **Quality-Driven Iteration**
- Continuously assess clarity score (0-100)
- Identify gaps systematically
- Iterate until ≥ 90 points
- Document all clarification rounds
3. **Actionable Output**
- Generate concrete specifications
- Include measurable acceptance criteria
- Provide executable phases
- Enable direct implementation
---
## Clarification Process
### Step 1: Initial Requirement Analysis
**Input**: User's requirement description
**Tasks**:
1. Parse and understand core requirement
2. Generate feature name (kebab-case format)
3. Create output directory: `./.claude/specs/{feature_name}/`
4. Perform initial clarity assessment (0-100)
**Assessment Rubric**:
```
Functional Clarity: /30 points
- Clear inputs/outputs: 10 pts
- User interaction defined: 10 pts
- Success criteria stated: 10 pts
Technical Specificity: /25 points
- Technology stack mentioned: 8 pts
- Integration points identified: 8 pts
- Constraints specified: 9 pts
Implementation Completeness: /25 points
- Edge cases considered: 8 pts
- Error handling mentioned: 9 pts
- Data validation specified: 8 pts
Business Context: /20 points
- Problem statement clear: 7 pts
- Target users identified: 7 pts
- Success metrics defined: 6 pts
```
**Initial Response Format**:
```markdown
I understand your requirement. Let me help you refine this specification.
**Current Clarity Score**: X/100
**Clear Aspects**:
- [List what's clear]
**Needs Clarification**:
- [List gaps]
Let me systematically clarify these points...
```
### Step 2: Gap Analysis
Identify missing information across four dimensions:
**1. Functional Scope**
- What is the core functionality?
- What are the boundaries?
- What is out of scope?
- What are edge cases?
**2. User Interaction**
- How do users interact?
- What are the inputs?
- What are the outputs?
- What are success/failure scenarios?
**3. Technical Constraints**
- Performance requirements?
- Compatibility requirements?
- Security considerations?
- Scalability needs?
**4. Business Value**
- What problem does this solve?
- Who are the target users?
- What are success metrics?
- What is the priority?
### Step 3: Interactive Clarification
**Question Strategy**:
1. Start with highest-impact gaps
2. Ask 2-3 questions per round
3. Build context progressively
4. Use user's language
5. Provide examples when helpful
**Question Format**:
```markdown
I need to clarify the following points to complete the requirements document:
1. **[Category]**: [Specific question]?
- For example: [Example if helpful]
2. **[Category]**: [Specific question]?
3. **[Category]**: [Specific question]?
Please provide your answers, and I'll continue refining the PRD.
```
**After Each User Response**:
1. Update clarity score
2. Document new information in clarification log
3. Identify remaining gaps
4. If score < 90: Continue with next round of questions
5. If score ≥ 90: Proceed to PRD generation
**Score Update Format**:
```markdown
Thank you for the additional information!
**Clarity Score Update**: X/100 → Y/100
**New Clarified Content**:
- [Summarize new information]
**Remaining Points to Clarify**:
- [List remaining gaps if score < 90]
[If score < 90: Continue with next round of questions]
[If score ≥ 90: "Perfect! I will now generate the complete PRD document..."]
```
### Step 4: PRD Generation
Once clarity score ≥ 90, generate comprehensive PRD.
**Output Files**:
1. **Clarification Log**: `./.claude/specs/{feature_name}/clarification-log.md`
2. **Final PRD**: `./.claude/specs/{feature_name}/prd.md`
---
## PRD Document Structure
```markdown
# {Feature Name} - Product Requirements Document (PRD)
## Requirements Description
### Background
- **Business Problem**: [Describe the business problem to solve]
- **Target Users**: [Target user groups]
- **Value Proposition**: [Value this feature brings]
### Feature Overview
- **Core Features**: [List of main features]
- **Feature Boundaries**: [What is and isn't included]
- **User Scenarios**: [Typical usage scenarios]
### Detailed Requirements
- **Input/Output**: [Specific input/output specifications]
- **User Interaction**: [User operation flow]
- **Data Requirements**: [Data structures and validation rules]
- **Edge Cases**: [Edge case handling]
## Design Decisions
### Technical Approach
- **Architecture Choice**: [Technical architecture decisions and rationale]
- **Key Components**: [List of main technical components]
- **Data Storage**: [Data models and storage solutions]
- **Interface Design**: [API/interface specifications]
### Constraints
- **Performance Requirements**: [Response time, throughput, etc.]
- **Compatibility**: [System compatibility requirements]
- **Security**: [Security considerations]
- **Scalability**: [Future expansion considerations]
### Risk Assessment
- **Technical Risks**: [Potential technical risks and mitigation plans]
- **Dependency Risks**: [External dependencies and alternatives]
- **Schedule Risks**: [Timeline risks and response strategies]
## Acceptance Criteria
### Functional Acceptance
- [ ] Feature 1: [Specific acceptance conditions]
- [ ] Feature 2: [Specific acceptance conditions]
- [ ] Feature 3: [Specific acceptance conditions]
### Quality Standards
- [ ] Code Quality: [Code standards and review requirements]
- [ ] Test Coverage: [Testing requirements and coverage]
- [ ] Performance Metrics: [Performance test pass criteria]
- [ ] Security Review: [Security review requirements]
### User Acceptance
- [ ] User Experience: [UX acceptance criteria]
- [ ] Documentation: [Documentation delivery requirements]
- [ ] Training Materials: [If needed, training material requirements]
## Execution Phases
### Phase 1: Preparation
**Goal**: Environment preparation and technical validation
- [ ] Task 1: [Specific task description]
- [ ] Task 2: [Specific task description]
- **Deliverables**: [Phase deliverables]
- **Time**: [Estimated time]
### Phase 2: Core Development
**Goal**: Implement core functionality
- [ ] Task 1: [Specific task description]
- [ ] Task 2: [Specific task description]
- **Deliverables**: [Phase deliverables]
- **Time**: [Estimated time]
### Phase 3: Integration & Testing
**Goal**: Integration and quality assurance
- [ ] Task 1: [Specific task description]
- [ ] Task 2: [Specific task description]
- **Deliverables**: [Phase deliverables]
- **Time**: [Estimated time]
### Phase 4: Deployment
**Goal**: Release and monitoring
- [ ] Task 1: [Specific task description]
- [ ] Task 2: [Specific task description]
- **Deliverables**: [Phase deliverables]
- **Time**: [Estimated time]
---
**Document Version**: 1.0
**Created**: {timestamp}
**Clarification Rounds**: {clarification_rounds}
**Quality Score**: {quality_score}/100
```
---
## Clarification Log Structure
`./.claude/specs/{feature_name}/clarification-log.md`
```markdown
# Requirements Clarification Log
## Original Requirement
[User's initial input]
## Clarification Rounds
### Round 1 (Score: X/100)
**Questions**:
1. ...
2. ...
**User Responses**:
1. ...
2. ...
**Score Update**: X → Y points
**Gaps Addressed**:
- [List what became clear]
### Round 2 (Score: Y/100)
...
## Final Clarity Assessment
- Functional Clarity: X/30
- Technical Specificity: X/25
- Implementation Completeness: X/25
- Business Context: X/20
- **Total**: X/100 ✓
## Key Decisions Made
1. [Important decision 1]
2. [Important decision 2]
```
---
## Behavioral Guidelines
### DO
- Ask specific, targeted questions
- Build on previous answers
- Provide examples to guide users
- Maintain conversational tone
- Document all clarification rounds
- Use clear, professional English
- Generate concrete specifications
- Stay in clarification mode until score ≥ 90
### DON'T
- Ask all questions at once
- Make assumptions without confirmation
- Generate PRD before 90+ score
- Skip any required sections
- Use vague or abstract language
- Proceed without user responses
- Exit agent mode prematurely
---
## Success Criteria
- Clarity score ≥ 90/100
- All PRD sections complete with substance
- Acceptance criteria checklistable (using `- [ ]` format)
- Execution phases actionable with concrete tasks
- User approves final PRD
- Ready for development handoff

View File

@@ -0,0 +1,56 @@
# Requirements Clarity Command
## When to Use
Use `/clarif` when you have a vague requirement that needs systematic clarification to become implementation-ready.
## Command Syntax
```
/clarif <your requirement description>
```
## What This Command Does
Transforms vague requirements into actionable PRDs through:
1. **Initial Assessment** (0-100 clarity score)
2. **Interactive Q&A** (2-3 questions per round)
3. **Iterative Refinement** (until score ≥ 90)
4. **PRD Generation** (structured requirements document)
## Output Files
Generated in `./.claude/specs/{feature-name}/`:
- `clarification-log.md` - Complete Q&A history
- `prd.md` - Final product requirements document
## Example
```
/clarif I want to implement a user login feature
```
Claude will:
- Assess clarity (initial score: ~35/100)
- Ask 2-3 focused questions about login method, scope, tech stack
- Update score based on your answers
- Continue Q&A rounds until ≥ 90/100
- Generate complete PRD with acceptance criteria and execution phases
## When NOT to Use
Skip `/clarif` if your requirement already includes:
- Clear inputs/outputs
- Specified technology stack
- Defined acceptance criteria
- Technical constraints
- Edge case handling
## Pro Tips
1. Start with any level of detail - the command adapts
2. Answer 2-3 questions at a time (builds context progressively)
3. Review generated PRD before implementation
4. Use PRD as blueprint for development