mirror of
https://github.com/cexll/myclaude.git
synced 2026-02-14 03:31:58 +08:00
Convert requirements-clarity to plugin format with English prompts
Changes: - Migrate from .claude/skills/ to .claude/plugins/ structure - Add claude.json plugin metadata - Create instructions.md with all English prompts (no Chinese) - Update README.md for plugin distribution - Update .gitignore to allow .claude/plugins/ Plugin structure: - claude.json: Plugin metadata (name, version, components) - instructions.md: Main skill prompt (100% English) - README.md: Plugin documentation and usage guide Maintains all functionality: - 100-point scoring system - Iterative clarification (≥90 threshold) - PRD generation with 4 sections - Auto-activation on vague requirements Fixes #17 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,18 +1,37 @@
|
|||||||
# Requirements Clarity Skill
|
# Requirements Clarity Plugin
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
This Claude Skill automatically detects vague requirements and transforms them into crystal-clear Product Requirements Documents (PRDs) through systematic clarification.
|
This Claude Code plugin automatically detects vague requirements and transforms them into crystal-clear Product Requirements Documents (PRDs) through systematic clarification.
|
||||||
|
|
||||||
**Key Difference from `/clarif` Command**:
|
**Plugin vs Skill vs Command**:
|
||||||
- **Command**: User must type `/clarif <requirement>` explicitly
|
- **Plugin**: Distributable package with metadata (`claude.json`)
|
||||||
- **Skill**: Claude automatically detects unclear requirements and activates clarification mode
|
- **Skill**: Auto-activated behavior (part of plugin)
|
||||||
|
- **Command**: Manual invocation (deprecated in favor of plugin)
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
/plugin install requirements-clarity
|
||||||
|
```
|
||||||
|
|
||||||
|
Or add to your `.clauderc`:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"plugins": {
|
||||||
|
"requirements-clarity": {
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## How It Works
|
## How It Works
|
||||||
|
|
||||||
### Automatic Activation
|
### Automatic Activation
|
||||||
|
|
||||||
The skill activates when Claude detects:
|
The plugin activates when Claude detects:
|
||||||
|
|
||||||
1. **Vague Feature Requests**
|
1. **Vague Feature Requests**
|
||||||
```
|
```
|
||||||
@@ -181,18 +200,7 @@ Structured PRD with four main sections:
|
|||||||
- Skill does NOT activate (requirement is already clear)
|
- Skill does NOT activate (requirement is already clear)
|
||||||
- Claude proceeds directly to implementation
|
- Claude proceeds directly to implementation
|
||||||
|
|
||||||
## Comparison: Command vs Skill
|
## Benefits
|
||||||
|
|
||||||
| Aspect | `/clarif` Command | Requirements-Clarity Skill |
|
|
||||||
|--------|-------------------|----------------------------|
|
|
||||||
| **Activation** | Manual: `/clarif <requirement>` | Automatic: Claude detects vague specs |
|
|
||||||
| **User Awareness** | Must know command exists | Transparent, no learning curve |
|
|
||||||
| **Workflow** | User → Type command → Clarification | User → Express need → Auto-clarification |
|
|
||||||
| **Discoverability** | Requires documentation | Claude suggests when appropriate |
|
|
||||||
| **Use Case** | Explicit requirements review | Proactive quality gate |
|
|
||||||
| **File Location** | `commands/clarif.md` + `agents/clarif-agent.md` | `.claude/skills/requirements-clarity/SKILL.md` |
|
|
||||||
|
|
||||||
## Benefits of Skill Approach
|
|
||||||
|
|
||||||
1. **Proactive Quality Gate**: Prevents unclear specs from proceeding to implementation
|
1. **Proactive Quality Gate**: Prevents unclear specs from proceeding to implementation
|
||||||
2. **Zero Friction**: Users describe features naturally, no command syntax needed
|
2. **Zero Friction**: Users describe features naturally, no command syntax needed
|
||||||
@@ -202,37 +210,37 @@ Structured PRD with four main sections:
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
No configuration needed - the skill is automatically discovered by Claude Code when present in `.claude/skills/requirements-clarity/`.
|
No configuration needed - the plugin is automatically discovered by Claude Code when installed.
|
||||||
|
|
||||||
**Skill Metadata** (in SKILL.md frontmatter):
|
**Plugin Metadata** (in claude.json):
|
||||||
```yaml
|
```json
|
||||||
name: requirements-clarity
|
{
|
||||||
description: Automatically clarify vague requirements into actionable PRDs
|
"name": "requirements-clarity",
|
||||||
activation_triggers:
|
"version": "1.0.0",
|
||||||
- User describes feature without technical details
|
"description": "Automatically clarify vague requirements into actionable PRDs",
|
||||||
- Request lacks acceptance criteria
|
"components": {
|
||||||
- Scope is ambiguous
|
"skills": ["requirements-clarity"]
|
||||||
- Missing technology stack
|
}
|
||||||
tools: Read, Write, Glob, Grep, TodoWrite
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
### Skill Not Activating
|
### Plugin Not Activating
|
||||||
|
|
||||||
**Problem**: Claude doesn't enter clarification mode for vague requirements
|
**Problem**: Claude doesn't enter clarification mode for vague requirements
|
||||||
|
|
||||||
**Solutions**:
|
**Solutions**:
|
||||||
1. Verify `.claude/skills/requirements-clarity/SKILL.md` exists
|
1. Verify plugin is installed: `/plugin list`
|
||||||
2. Check YAML frontmatter is valid
|
2. Check plugin is enabled in `.clauderc`
|
||||||
3. Ensure activation_triggers are defined
|
3. Ensure `instructions.md` exists in plugin directory
|
||||||
4. Try more explicit vague requirement: "add user feature"
|
4. Try more explicit vague requirement: "add user feature"
|
||||||
|
|
||||||
### Premature PRD Generation
|
### Premature PRD Generation
|
||||||
|
|
||||||
**Problem**: PRD generated before score reaches 90
|
**Problem**: PRD generated before score reaches 90
|
||||||
|
|
||||||
**Solution**: This is a bug - SKILL.md explicitly requires ≥90 threshold. Review the clarification log to see actual score.
|
**Solution**: This is a bug - instructions.md explicitly requires ≥90 threshold. Review the clarification log to see actual score.
|
||||||
|
|
||||||
### Over-Clarification
|
### Over-Clarification
|
||||||
|
|
||||||
@@ -240,23 +248,11 @@ tools: Read, Write, Glob, Grep, TodoWrite
|
|||||||
|
|
||||||
**Expected**: This is by design - better to over-clarify than under-specify. If the requirement is truly simple, answer questions quickly to reach 90+ score faster.
|
**Expected**: This is by design - better to over-clarify than under-specify. If the requirement is truly simple, answer questions quickly to reach 90+ score faster.
|
||||||
|
|
||||||
## Migration from `/clarif` Command
|
|
||||||
|
|
||||||
The `/clarif` command in `development-essentials/commands/clarif.md` can coexist with this skill:
|
|
||||||
|
|
||||||
- **Skill**: Automatic activation for new, unclear requirements
|
|
||||||
- **Command**: Explicit review of existing requirements
|
|
||||||
|
|
||||||
**Recommended Workflow**:
|
|
||||||
1. User describes feature naturally
|
|
||||||
2. Skill auto-activates and generates PRD
|
|
||||||
3. (Optional) User runs `/clarif <existing-prd>` to review/refine
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### Example 1: Login Feature (Full Flow)
|
### Example 1: Login Feature (Full Flow)
|
||||||
|
|
||||||
See full example in SKILL.md under "Example Clarification Flow"
|
See full example in instructions.md under "Example Clarification Flow"
|
||||||
|
|
||||||
**Summary**:
|
**Summary**:
|
||||||
- Input: "I want to implement a user login feature"
|
- Input: "I want to implement a user login feature"
|
||||||
@@ -294,18 +290,22 @@ PRD Generated:
|
|||||||
|
|
||||||
## References
|
## References
|
||||||
|
|
||||||
- **Claude Skills Documentation**: https://docs.claude.com/en/docs/claude-code/skills
|
- **Claude Code Plugins Documentation**: https://docs.claude.com/en/docs/claude-code/plugins
|
||||||
- **Anthropic Skills Announcement**: https://www.anthropic.com/news/skills
|
|
||||||
- **Original `/clarif` Command**: `development-essentials/commands/clarif.md`
|
- **Original `/clarif` Command**: `development-essentials/commands/clarif.md`
|
||||||
- **Original Clarification Agent**: `development-essentials/agents/clarif-agent.md`
|
- **Original Clarification Agent**: `development-essentials/agents/clarif-agent.md`
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
### v1.0 (2025-10-20)
|
### v1.0.0 (2025-10-21)
|
||||||
- Initial skill implementation
|
- Converted skill to plugin format
|
||||||
- Ported clarification logic from `/clarif` command
|
- Added `claude.json` plugin metadata
|
||||||
- Added automatic activation triggers
|
- Translated all prompts to English (was mixed Chinese/English)
|
||||||
- Implemented 100-point scoring system
|
- Updated documentation for plugin distribution
|
||||||
- Created structured PRD template with Requirements/Design/Acceptance/Execution sections
|
- Maintained 100-point scoring system and PRD structure
|
||||||
- Added comprehensive test cases and examples
|
- Compatible with Claude Code plugin system
|
||||||
- Translated to English for plugin compatibility
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**License**: MIT
|
||||||
|
**Author**: stellarlink
|
||||||
|
**Homepage**: https://github.com/cexll/myclaude
|
||||||
11
.claude/plugins/requirements-clarity/claude.json
Normal file
11
.claude/plugins/requirements-clarity/claude.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"name": "requirements-clarity",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Automatically detect vague requirements and transform them into crystal-clear Product Requirements Documents (PRDs) through systematic clarification",
|
||||||
|
"author": "stellarlink",
|
||||||
|
"homepage": "https://github.com/cexll/myclaude",
|
||||||
|
"instructions": "instructions.md",
|
||||||
|
"components": {
|
||||||
|
"skills": ["requirements-clarity"]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,21 +1,8 @@
|
|||||||
---
|
|
||||||
name: requirements-clarity
|
|
||||||
description: Automatically detect vague requirements and transform them into crystal-clear Product Requirements Documents (PRDs) through systematic clarification
|
|
||||||
activation_triggers:
|
|
||||||
- User describes a feature without technical details
|
|
||||||
- Request lacks acceptance criteria or success metrics
|
|
||||||
- Scope is ambiguous (e.g., "add authentication", "implement user management")
|
|
||||||
- Missing technology stack or implementation constraints
|
|
||||||
- No edge cases or error handling mentioned
|
|
||||||
- Vague action verbs without specifics ("add", "create", "improve", "fix")
|
|
||||||
tools: Read, Write, Glob, Grep, TodoWrite
|
|
||||||
---
|
|
||||||
|
|
||||||
# Requirements Clarity Skill
|
# Requirements Clarity Skill
|
||||||
|
|
||||||
## When to Activate
|
## When to Activate
|
||||||
|
|
||||||
This skill should automatically activate when Claude detects:
|
This skill automatically activates when Claude detects:
|
||||||
|
|
||||||
1. **Vague Feature Requests**
|
1. **Vague Feature Requests**
|
||||||
- User says: "add login feature", "implement payment", "create dashboard"
|
- User says: "add login feature", "implement payment", "create dashboard"
|
||||||
@@ -494,7 +481,7 @@ Requirements are now very clear. I will now generate the complete PRD document..
|
|||||||
- Acceptance Criteria: 12 functional acceptance + 8 quality standards
|
- Acceptance Criteria: 12 functional acceptance + 8 quality standards
|
||||||
- Execution Phases: 4 phases, estimated 2-3 weeks
|
- Execution Phases: 4 phases, estimated 2-3 weeks
|
||||||
|
|
||||||
You can review the document and confirm if any adjustments are needed. If satisfied, I can start implementation immediately! 🚀
|
You can review the document and confirm if any adjustments are needed. If satisfied, I can start implementation immediately!
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -503,7 +490,7 @@ You can review the document and confirm if any adjustments are needed. If satisf
|
|||||||
|
|
||||||
- Clarity score ≥ 90/100
|
- Clarity score ≥ 90/100
|
||||||
- All PRD sections complete with substance
|
- All PRD sections complete with substance
|
||||||
- Acceptance criteria checklistable (使用 `- [ ]` 格式)
|
- Acceptance criteria checklistable (using `- [ ]` format)
|
||||||
- Execution phases actionable with concrete tasks
|
- Execution phases actionable with concrete tasks
|
||||||
- User approves final PRD
|
- User approves final PRD
|
||||||
- Ready for development handoff
|
- Ready for development handoff
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
|||||||
CLAUDE.md
|
CLAUDE.md
|
||||||
|
|
||||||
.claude/*
|
.claude/*
|
||||||
!.claude/skills/
|
!.claude/plugins/
|
||||||
|
|||||||
Reference in New Issue
Block a user