mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-15 02:42:45 +08:00
- Updated SKILL.md to reflect new requirement analysis capabilities, including input analysis and clarity scoring. - Expanded issue workflow in issue.md to include discovery and creation phases, along with detailed command references. - Introduced requirement analysis specification in requirement-analysis.md, outlining clarity scoring, dimension extraction, and validation processes. - Added output templates specification in output-templates.md for consistent user experience across classification, planning, clarification, execution, and summary outputs.
5.9 KiB
5.9 KiB
Output Templates Specification
CCW 标准输出格式模板,确保一致的用户体验。
Template Categories
| Category | Usage | Key Elements |
|---|---|---|
| Classification | Intent/complexity output | Intent, Complexity, Source |
| Planning | Chain selection output | Chain, Steps, Estimated time |
| Clarification | User interaction | Questions, Options, Context |
| Execution | Progress updates | Step, Status, Progress bar |
| Summary | Final results | Completed, Duration, Artifacts |
Classification Output Template
### Classification Summary
- **Source**: [Rule-Based|CLI-Assisted] ([confidence]% confidence)
- **Intent**: [intent_type] ([variant])
- **Complexity**: [low|medium|high]
- **Reasoning**: [brief explanation]
**Recommended Workflow**: [chain_name]
Example
### Classification Summary
- **Source**: CLI-Assisted (85% confidence)
- **Intent**: feature (implementation)
- **Complexity**: medium
- **Reasoning**: Request involves creating new functionality with moderate scope
**Recommended Workflow**: lite-plan → lite-execute
Requirement Analysis Template
### Requirement Analysis
**Input**: [truncated user input...]
| Dimension | Value | Status |
|-----------|-------|--------|
| WHAT | [action] [target] | ✓ extracted |
| WHERE | [scope]: [paths] | ✓ extracted |
| WHY | [goal] | ⚠ inferred |
| HOW | [constraints] | ✗ missing |
**Clarity Score**: [score]/3 ([level])
**Action**: [proceed|clarify|confirm]
Planning Output Template
### Workflow Planning
**Selected Chain**: [chain_name] ([chain_id])
**Description**: [chain_description]
**Complexity**: [chain_complexity]
**Estimated Time**: [estimated_time]
**Execution Steps**:
| # | Command | Auto | Description |
|---|---------|------|-------------|
| 1 | [command] | [Y/N] | [step description] |
| 2 | [command] | [Y/N] | [step description] |
**Risks**: [identified risks or "None identified"]
**Suggestions**: [optimization suggestions or "N/A"]
Clarification Output Template
### Clarification Needed
Your request needs more detail. Please help me understand:
**Missing Information**:
- [ ] [dimension]: [what's needed]
**Questions**:
[AskUserQuestion widget renders here]
Execution Progress Template
### Execution Progress
**Workflow**: [chain_name]
**Status**: [step N of M]
[████████░░░░░░░░] 50% (2/4 steps)
**Current Step**: [current command]
**Completed**:
- ✓ [step 1 command]
- ✓ [step 2 command]
**Pending**:
- ○ [step 3 command]
- ○ [step 4 command]
Summary Output Template
### Workflow Complete
**Chain**: [chain_name]
**Duration**: [elapsed time]
**Steps**: [completed]/[total]
**Results**:
| Step | Status | Notes |
|------|--------|-------|
| [command] | ✓ | [result notes] |
**Artifacts Generated**:
- [artifact path]
**Next Actions** (optional):
- [suggested follow-up]
Error Output Template
### Workflow Error
**Step**: [failed step command]
**Error**: [error message]
**Possible Causes**:
- [cause 1]
- [cause 2]
**Suggested Actions**:
1. [action 1]
2. [action 2]
Type `retry` to retry or `abort` to stop.
Issue Workflow Templates
Issue Discovery Output
### Issue Discovery
**Perspectives Analyzed**: [list of perspectives]
**Issues Found**: [count]
| ID | Type | Severity | Location | Description |
|----|------|----------|----------|-------------|
| [ISS-xxx] | [type] | [severity] | [file:line] | [brief] |
**Recommended Next Step**: `/issue:new` or `/issue:plan`
Issue Queue Output
### Execution Queue
**Queue ID**: [QUE-xxx]
**Total Solutions**: [count]
**Execution Groups**: [count]
**Queue Structure**:
[P1] Parallel Group (2 solutions) ├─ SOL-001: [description] └─ SOL-002: [description] ↓ [S1] Sequential (depends on P1) └─ SOL-003: [description]
**Conflicts Detected**: [count] ([severity level])
Issue Execution Progress
### Issue Execution
**Queue**: [QUE-xxx]
**Progress**: [completed]/[total] solutions
[████████░░░░░░░░] 50%
**Current Group**: [P1|S1|...]
**Executing**: [SOL-xxx] - [description]
**Completed**:
- ✓ SOL-001: [result]
- ✓ SOL-002: [result]
**ETA**: [estimated time remaining]
Implementation Guide
// Template rendering function
function renderTemplate(templateType, data) {
const templates = {
classification: renderClassification,
requirement: renderRequirement,
planning: renderPlanning,
clarification: renderClarification,
execution: renderExecution,
summary: renderSummary,
error: renderError
}
return templates[templateType](data)
}
// Example: Classification template
function renderClassification(data) {
return `### Classification Summary
- **Source**: ${data.source} ${data.confidence ? `(${Math.round(data.confidence * 100)}% confidence)` : ''}
- **Intent**: ${data.intent.type}${data.intent.variant ? ` (${data.intent.variant})` : ''}
- **Complexity**: ${data.complexity}
${data.reasoning ? `- **Reasoning**: ${data.reasoning}` : ''}
**Recommended Workflow**: ${data.workflow}`
}
// Progress bar helper
function renderProgressBar(completed, total, width = 16) {
const filled = Math.round((completed / total) * width)
const empty = width - filled
const percentage = Math.round((completed / total) * 100)
return `[${'█'.repeat(filled)}${'░'.repeat(empty)}] ${percentage}% (${completed}/${total})`
}
Consistency Rules
- Headers: Always use
###for section headers - Tables: Use markdown tables for structured data
- Status Icons: ✓ (done), ○ (pending), ⚠ (warning), ✗ (error)
- Progress: Always show percentage and fraction
- Timing: Show elapsed time in human-readable format
- Paths: Show relative paths when possible