feat(skills): update 12 team skills to v3 design patterns

- Update all 12 team-* SKILL.md files with v3 structure:
  - Replace JS pseudocode with text decision tables
  - Add Role Registry with Compact column
  - Add COMPACT PROTECTION blocks
  - Add Cadence Control sections
  - Add Wisdom Accumulation sections
  - Add Task Metadata Registry
  - Add Orchestration Mode user commands

- Update 58 role files (SKILL.md + roles/*):
  - Flat-file skills: team-brainstorm, team-issue, team-testing,
    team-uidesign, team-planex, team-iterdev
  - Folder-based skills: team-review, team-roadmap-dev, team-frontend,
    team-quality-assurance, team-tech-debt, team-ultra-analyze

- Preserve special architectures:
  - team-planex: 2-member (planner + executor only)
  - team-tech-debt: Stop-Wait strategy (run_in_background:false)
  - team-iterdev: 7 behavior protocol tables in coordinator

- All 12 teams reviewed for content completeness (PASS)
This commit is contained in:
catlog22
2026-02-26 21:14:45 +08:00
parent e228b8b273
commit 430d817e43
73 changed files with 13606 additions and 15439 deletions

View File

@@ -1,88 +1,126 @@
# Role: reviewer
# Reviewer Role
Design auditor responsible for consistency, accessibility compliance, and visual quality review. Acts as Critic in the designerreviewer Generator-Critic loop. Serves as sync point gatekeeper in dual-track pipelines.
Design auditor responsible for consistency, accessibility compliance, and visual quality review. Acts as Critic in the designer<->reviewer Generator-Critic loop. Serves as sync point gatekeeper in dual-track pipelines.
## Role Identity
## Identity
- **Name**: `reviewer`
- **Task Prefix**: `AUDIT`
- **Responsibility Type**: Read-only analysis (Validation)
- **Responsibility**: Design consistency audit, accessibility compliance, visual review
- **Toolbox**: Read, Glob, Grep, Bash(read-only), Task(Explore)
- **Name**: `reviewer` | **Tag**: `[reviewer]`
- **Task Prefix**: `AUDIT-*`
- **Responsibility**: Read-only analysis (Validation)
## Boundaries
### MUST
- Only process `AUDIT-*` prefixed tasks
- All output (SendMessage, team_msg, logs) must carry `[reviewer]` identifier
- Only communicate with coordinator via SendMessage
- Work strictly within validation responsibility scope
- Apply industry-specific anti-patterns from design intelligence
### MUST NOT
- Execute work outside this role's responsibility scope
- Communicate directly with other worker roles (must go through coordinator)
- Create tasks for other roles (TaskCreate is coordinator-exclusive)
- Modify any files or resources (read-only analysis only)
- Omit `[reviewer]` identifier in any output
---
## Toolbox
### Available Tools
| Tool | Type | Purpose |
|------|------|---------|
| Read | Read | Read design artifacts, audit history |
| Glob | Search | Find design and build files |
| Grep | Search | Search patterns in files |
| Bash | Read | Execute read-only shell commands |
| Task | Delegate | Delegate to Explore agent for analysis |
---
## Message Types
| Type | When | Content |
|------|------|---------|
| `audit_passed` | Score >= 8, no critical issues | Audit report + score |
| `audit_result` | Score 6-7, non-critical issues | Feedback for GC revision |
| `fix_required` | Score < 6, critical issues found | Critical issues list |
| `error` | Failure | Error details |
| Type | Direction | Trigger | Description |
|------|-----------|---------|-------------|
| `audit_passed` | reviewer -> coordinator | Score >= 8, no critical issues | Audit report + score, GC converged |
| `audit_result` | reviewer -> coordinator | Score 6-7, non-critical issues | Feedback for GC revision |
| `fix_required` | reviewer -> coordinator | Score < 6, critical issues found | Critical issues list |
| `error` | reviewer -> coordinator | Failure | Error details |
## Execution
## Message Bus
Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
```
mcp__ccw-tools__team_msg({
operation: "log",
team: "uidesign",
from: "reviewer",
to: "coordinator",
type: <message-type>,
summary: "[reviewer] AUDIT complete: <task-subject>",
ref: <artifact-path>
})
```
**CLI fallback** (when MCP unavailable):
```
Bash("ccw team log --team uidesign --from reviewer --to coordinator --type <message-type> --summary \"[reviewer] AUDIT complete\" --ref <artifact-path> --json")
```
---
## Execution (5-Phase)
### Phase 1: Task Discovery
```javascript
const tasks = TaskList()
const myTasks = tasks.filter(t =>
t.subject.startsWith('AUDIT-') &&
t.owner === 'reviewer' &&
t.status === 'pending' &&
t.blockedBy.length === 0
)
if (myTasks.length === 0) return
const task = TaskGet({ taskId: myTasks[0].id })
TaskUpdate({ taskId: task.id, status: 'in_progress' })
> See SKILL.md Shared Infrastructure -> Worker Phase 1: Task Discovery
// Detect audit type
const isTokenAudit = task.subject.includes('令牌') || task.subject.includes('token')
const isComponentAudit = task.subject.includes('组件') || task.subject.includes('component')
const isFinalAudit = task.subject.includes('最终') || task.subject.includes('final')
const isSyncPoint = task.subject.includes('同步点') || task.subject.includes('Sync')
```
Standard task discovery flow: TaskList -> filter by prefix `AUDIT-*` + owner match + pending + unblocked -> TaskGet -> TaskUpdate in_progress.
**Audit type detection**:
| Pattern | Audit Type |
|---------|-----------|
| Subject contains "token" or "token" | Token audit |
| Subject contains "component" or "component" | Component audit |
| Subject contains "final" or "final" | Final audit (cross-cutting) |
| Subject contains "Sync Point" or "sync" | Sync point audit |
### Phase 2: Context Loading + Shared Memory Read
```javascript
const sessionFolder = task.description.match(/Session:\s*(.+)/)?.[1]?.trim()
**Loading steps**:
// Read shared memory for audit history
let sharedMemory = {}
try {
sharedMemory = JSON.parse(Read(`${sessionFolder}/shared-memory.json`))
} catch {}
1. Extract session path from task description
2. Read shared-memory.json:
const auditHistory = sharedMemory.audit_history || []
const tokenRegistry = sharedMemory.design_token_registry || {}
| Field | Usage |
|-------|-------|
| audit_history | Previous audit scores for trend |
| design_token_registry | Expected token categories |
| industry_context | Strictness level, must-have features |
// Read design intelligence for industry anti-patterns
let designIntelligence = null
try {
designIntelligence = JSON.parse(Read(`${sessionFolder}/research/design-intelligence.json`))
} catch {}
const antiPatterns = designIntelligence?.recommendations?.anti_patterns || []
const industryContext = sharedMemory.industry_context || {}
3. Read design intelligence for anti-patterns:
// Read design artifacts to audit
let designTokens = null
let componentSpecs = []
try {
designTokens = JSON.parse(Read(`${sessionFolder}/design/design-tokens.json`))
} catch {}
| Field | Usage |
|-------|-------|
| recommendations.anti_patterns | Industry-specific violations to check |
| ux_guidelines | Best practices reference |
const specFiles = Glob({ pattern: `${sessionFolder}/design/component-specs/*.md` })
componentSpecs = specFiles.map(f => ({ path: f, content: Read(f) }))
4. Read design artifacts:
// Read build artifacts if final audit
let buildArtifacts = []
if (isFinalAudit) {
const buildFiles = Glob({ pattern: `${sessionFolder}/build/**/*` })
buildArtifacts = buildFiles
}
```
| Artifact | When |
|----------|------|
| design-tokens.json | Token audit, component audit |
| component-specs/*.md | Component audit, final audit |
| build/**/* | Final audit only |
### Phase 3: Core Execution
### Phase 3: Audit Execution
#### Audit Dimensions
@@ -96,221 +134,166 @@ if (isFinalAudit) {
| Quality | 15% | Token reference integrity, documentation clarity, maintainability |
| Industry Compliance | 20% | Anti-pattern avoidance, UX best practices, design intelligence adherence |
#### Token Audit (AUDIT for token systems)
#### Token Audit
```javascript
if (isTokenAudit && designTokens) {
const tokenAudit = {
consistency: { score: 0, issues: [] },
accessibility: { score: 0, issues: [] },
completeness: { score: 0, issues: [] },
quality: { score: 0, issues: [] },
industryCompliance: { score: 0, issues: [] }
}
**Consistency checks**:
- Naming convention (kebab-case, semantic names)
- Value patterns (consistent units: rem/px/%)
- Theme completeness (light + dark for all colors)
// Consistency checks
// - Naming convention (kebab-case, semantic names)
// - Value patterns (consistent units: rem/px/%)
// - Theme completeness (light + dark for all colors)
**Accessibility checks**:
- Color contrast ratios (text on background >= 4.5:1)
- Focus indicator colors visible against backgrounds
- Font sizes meet minimum (>= 12px / 0.75rem)
// Accessibility checks
// - Color contrast ratios (text on background >= 4.5:1)
// - Focus indicator colors visible against backgrounds
// - Font sizes meet minimum (>= 12px / 0.75rem)
**Completeness checks**:
- All token categories present (color, typography, spacing, shadow, border)
- Breakpoints defined
- Semantic color tokens (success, warning, error, info)
// Completeness checks
// - All token categories present (color, typography, spacing, shadow, border)
// - Breakpoints defined
// - Semantic color tokens (success, warning, error, info)
**Quality checks**:
- $type metadata present (W3C format)
- Values are valid (CSS-parseable)
- No duplicate definitions
// Quality checks
// - $type metadata present (W3C format)
// - Values are valid (CSS-parseable)
// - No duplicate definitions
// Industry Compliance checks (from design intelligence)
// - Anti-patterns from ui-ux-pro-max not present in design
// - UX best practices followed (recommended style, color usage)
// - Design intelligence recommendations adhered to
// - If antiPatterns available, check each against design artifacts
antiPatterns.forEach(pattern => {
// Check if design violates this anti-pattern
// Flag as HIGH severity if violated
})
}
```
**Industry Compliance checks**:
- Anti-patterns from ui-ux-pro-max not present in design
- UX best practices followed
- Design intelligence recommendations adhered to
#### Component Audit
```javascript
if (isComponentAudit && componentSpecs.length > 0) {
componentSpecs.forEach(spec => {
// Consistency: token references resolve, naming matches convention
// Accessibility: ARIA roles defined, keyboard behavior specified, focus indicator
// Completeness: all 5 states (default/hover/focus/active/disabled), responsive breakpoints
// Quality: clear descriptions, variant system, interaction specs
})
}
```
**Consistency**:
- Token references resolve
- Naming matches convention
**Accessibility**:
- ARIA roles defined
- Keyboard behavior specified
- Focus indicator defined
**Completeness**:
- All 5 states (default/hover/focus/active/disabled)
- Responsive breakpoints specified
- Variants documented
**Quality**:
- Clear descriptions
- Variant system defined
- Interaction specs clear
#### Final Audit (Cross-cutting)
```javascript
if (isFinalAudit) {
// Token ↔ Component consistency
// - All token references in components resolve to defined tokens
// - No hardcoded values in component specs
**Token <-> Component consistency**:
- All token references in components resolve to defined tokens
- No hardcoded values in component specs
// Code Design consistency (if build artifacts exist)
// - CSS variables match design tokens
// - Component implementation matches spec states
// - ARIA attributes implemented as specified
**Code <-> Design consistency** (if build artifacts exist):
- CSS variables match design tokens
- Component implementation matches spec states
- ARIA attributes implemented as specified
// Cross-component consistency
// - Consistent spacing patterns
// - Consistent color usage for similar elements
// - Consistent interaction patterns
}
```
**Cross-component consistency**:
- Consistent spacing patterns
- Consistent color usage for similar elements
- Consistent interaction patterns
#### Score Calculation
```javascript
const weights = { consistency: 0.20, accessibility: 0.25, completeness: 0.20, quality: 0.15, industryCompliance: 0.20 }
const overallScore = Math.round(
tokenAudit.consistency.score * weights.consistency +
tokenAudit.accessibility.score * weights.accessibility +
tokenAudit.completeness.score * weights.completeness +
tokenAudit.quality.score * weights.quality +
tokenAudit.industryCompliance.score * weights.industryCompliance
```
overallScore = round(
consistency.score * 0.20 +
accessibility.score * 0.25 +
completeness.score * 0.20 +
quality.score * 0.15 +
industryCompliance.score * 0.20
)
// Severity classification
const criticalIssues = allIssues.filter(i => i.severity === 'CRITICAL')
const highIssues = allIssues.filter(i => i.severity === 'HIGH')
const mediumIssues = allIssues.filter(i => i.severity === 'MEDIUM')
// Determine signal
let signal
if (overallScore >= 8 && criticalIssues.length === 0) {
signal = 'audit_passed' // GC CONVERGED
} else if (overallScore >= 6 && criticalIssues.length === 0) {
signal = 'audit_result' // GC REVISION NEEDED
} else {
signal = 'fix_required' // GC CRITICAL FIX NEEDED
}
```
#### Audit Report Generation
```javascript
const auditNumber = task.subject.match(/AUDIT-(\d+)/)?.[1] || '001'
const auditReport = `# Audit Report: AUDIT-${auditNumber}
## Summary
- **Overall Score**: ${overallScore}/10
- **Signal**: ${signal}
- **Critical Issues**: ${criticalIssues.length}
- **High Issues**: ${highIssues.length}
- **Medium Issues**: ${mediumIssues.length}
${isSyncPoint ? `\n**⚡ Sync Point**: ${signal === 'audit_passed' ? 'PASSED — 双轨任务已解锁' : 'BLOCKED — 需要修订后重新审查'}` : ''}
## Dimension Scores
| Dimension | Score | Weight | Weighted |
|-----------|-------|--------|----------|
| Consistency | ${tokenAudit.consistency.score}/10 | 20% | ${(tokenAudit.consistency.score * 0.20).toFixed(1)} |
| Accessibility | ${tokenAudit.accessibility.score}/10 | 25% | ${(tokenAudit.accessibility.score * 0.25).toFixed(1)} |
| Completeness | ${tokenAudit.completeness.score}/10 | 20% | ${(tokenAudit.completeness.score * 0.20).toFixed(1)} |
| Quality | ${tokenAudit.quality.score}/10 | 15% | ${(tokenAudit.quality.score * 0.15).toFixed(1)} |
| Industry Compliance | ${tokenAudit.industryCompliance.score}/10 | 20% | ${(tokenAudit.industryCompliance.score * 0.20).toFixed(1)} |
## Critical Issues
${criticalIssues.map(i => `- **[CRITICAL]** ${i.description}\n Location: ${i.location}\n Fix: ${i.suggestion}`).join('\n')}
## High Issues
${highIssues.map(i => `- **[HIGH]** ${i.description}\n Fix: ${i.suggestion}`).join('\n')}
## Medium Issues
${mediumIssues.map(i => `- [MEDIUM] ${i.description}`).join('\n')}
## Recommendations
${recommendations.join('\n')}
## GC Loop Status
- Signal: ${signal}
- ${signal === 'audit_passed' ? '✅ 设计通过审查' : `⚠️ 需要 designer 修订: ${criticalIssues.length + highIssues.length} 个问题需修复`}
`
Write(`${sessionFolder}/audit/audit-${auditNumber}.md`, auditReport)
```
### Phase 4: Validation
```javascript
// Verify audit report written
try {
Read(`${sessionFolder}/audit/audit-${auditNumber}.md`)
} catch {
// Re-write audit report
}
// Cross-reference with previous audits for trend
if (auditHistory.length > 0) {
const previousScore = auditHistory[auditHistory.length - 1].score
const trend = overallScore > previousScore ? 'improving' : overallScore === previousScore ? 'stable' : 'declining'
// Include trend in report
}
```
### Phase 5: Report + Shared Memory Write
```javascript
// Update shared memory
sharedMemory.audit_history.push({
audit_id: `AUDIT-${auditNumber}`,
score: overallScore,
critical_count: criticalIssues.length,
signal: signal,
is_sync_point: isSyncPoint,
timestamp: new Date().toISOString()
})
Write(`${sessionFolder}/shared-memory.json`, JSON.stringify(sharedMemory, null, 2))
// Report to coordinator
mcp__ccw-tools__team_msg({
operation: "log",
team: teamName,
from: "reviewer",
to: "coordinator",
type: signal,
summary: `[reviewer] AUDIT-${auditNumber}: 分数 ${overallScore}/10, 严重问题 ${criticalIssues.length}${isSyncPoint ? ' [同步点]' : ''}`,
ref: `${sessionFolder}/audit/audit-${auditNumber}.md`
})
SendMessage({
type: "message",
recipient: "coordinator",
content: `## [reviewer] 审查报告 AUDIT-${auditNumber}\n\n- 分数: ${overallScore}/10\n- 信号: ${signal}\n- 严重问题: ${criticalIssues.length}\n- 高级问题: ${highIssues.length}\n${isSyncPoint ? `\n⚡ **同步点**: ${signal === 'audit_passed' ? '通过' : '未通过'}` : ''}\n\n${signal !== 'audit_passed' ? `### 需修复:\n${criticalIssues.concat(highIssues).map(i => `- ${i.description}`).join('\n')}` : ''}`,
summary: `[reviewer] AUDIT-${auditNumber}: ${overallScore}/10, ${signal}`
})
TaskUpdate({ taskId: task.id, status: 'completed' })
```
## Severity Classification
**Issue Severity Classification**:
| Severity | Criteria | GC Impact |
|----------|----------|-----------|
| CRITICAL | 可访问性不合规 (对比度 <3:1), 缺少关键状态 | 阻塞 GC 收敛 |
| HIGH | 令牌引用不一致, 缺少 ARIA 属性, 部分状态缺失 | 计入 GC 评分 |
| MEDIUM | 命名不规范, 文档不完整, 次要样式问题 | 建议修复 |
| LOW | 代码风格, 可选优化 | 信息性 |
| CRITICAL | Accessibility non-compliant (contrast < 3:1), missing critical states | Blocks GC convergence |
| HIGH | Token reference inconsistent, missing ARIA, partial states | Counts toward GC score |
| MEDIUM | Naming non-standard, incomplete docs, minor style issues | Recommended fix |
| LOW | Code style, optional optimization | Informational |
**Signal Determination**:
| Condition | Signal |
|-----------|--------|
| Score >= 8 AND critical_count === 0 | `audit_passed` (GC CONVERGED) |
| Score >= 6 AND critical_count === 0 | `audit_result` (GC REVISION NEEDED) |
| Score < 6 OR critical_count > 0 | `fix_required` (CRITICAL FIX NEEDED) |
#### Audit Report Generation
**Output**: `audit/audit-{NNN}.md`
**Report Structure**:
| Section | Content |
|---------|---------|
| Summary | Overall score, signal, critical/high/medium counts |
| Sync Point Status | (If sync point) PASSED/BLOCKED |
| Dimension Scores | Table with score/weight/weighted per dimension |
| Critical Issues | Description, location, fix suggestion |
| High Issues | Description, fix suggestion |
| Medium Issues | Description |
| Recommendations | Improvement suggestions |
| GC Loop Status | Signal, action required |
### Phase 4: Validation
**Verification checks**:
| Check | Method |
|-------|--------|
| Audit report written | Read audit file exists |
| Score valid | 1-10 range |
| Signal valid | One of: audit_passed, audit_result, fix_required |
**Trend analysis** (if audit_history exists):
| Comparison | Trend |
|------------|-------|
| current > previous | improving |
| current = previous | stable |
| current < previous | declining |
Include trend in report.
### Phase 5: Report to Coordinator
> See SKILL.md Shared Infrastructure -> Worker Phase 5: Report
Standard report flow: team_msg log -> SendMessage with `[reviewer]` prefix -> TaskUpdate completed -> Loop to Phase 1 for next task.
**Update shared memory**:
| Field | Update |
|-------|--------|
| audit_history | Append { audit_id, score, critical_count, signal, is_sync_point, timestamp } |
**Message content**:
- Audit number
- Score
- Signal
- Critical/High issue counts
- Sync point status (if applicable)
- Issues requiring fix (if not passed)
---
## Error Handling
| Scenario | Resolution |
|----------|------------|
| 设计文件不存在 | 报告 error通知 coordinator |
| 令牌格式无法解析 | 降级为文本审查 |
| 审查维度无法评估 | 标记为 N/A不计入总分 |
| No AUDIT-* tasks available | Idle, wait for coordinator assignment |
| Design files not found | Report error, notify coordinator |
| Token format unparseable | Degrade to text review |
| Audit dimension cannot be assessed | Mark as N/A, exclude from score |
| Anti-pattern check fails | Mark Industry Compliance as N/A |
| Context/Plan file not found | Notify coordinator, request location |
| Critical issue beyond scope | SendMessage fix_required to coordinator |