cmp-standards 3.8.1 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: experts
3
- description: Multi-expert code review with rigorous logical reasoning and evidence-based consensus
3
+ description: Multi-expert code review with rigorous logical reasoning, evidence-based consensus, and autonomous interaction style selection
4
4
  arguments:
5
5
  - name: target
6
6
  description: Files, directories, or task description to review
@@ -20,11 +20,99 @@ arguments:
20
20
  # /experts - Evidence-Based Code Review System
21
21
 
22
22
  > **Framework**: All experts use `_reasoning-framework.md` for rigorous logical analysis.
23
+ > **Version**: 3.0.0 (with Autonomous Deliberation)
23
24
 
24
25
  Execute this multi-phase expert review following the logical sequence below.
25
26
 
26
27
  ---
27
28
 
29
+ ## PHASE 0: AUTONOMOUS STYLE SELECTION (NEW)
30
+
31
+ Before executing, the orchestrator autonomously selects the optimal interaction style.
32
+
33
+ ### Interaction Styles
34
+
35
+ | Style | When Used | Expert Behavior |
36
+ |-------|-----------|-----------------|
37
+ | **SUMMARY** | Simple reviews (≤3 files, low complexity) | Quick cards, expand on demand |
38
+ | **DEBATE** | Trade-offs detected, experts likely to disagree | Experts discuss, user decides |
39
+ | **SOCRATIC** | Complex new features, learning opportunity | Questions instead of findings |
40
+ | **CLASSIC** | Critical code (auth, payment, schema) | Full rigorous analysis |
41
+
42
+ ### Style Selection Algorithm
43
+
44
+ ```typescript
45
+ function selectInteractionStyle(ctx: ReviewContext): InteractionStyle {
46
+ // CRITICAL code ALWAYS gets full analysis - no shortcuts
47
+ if (ctx.isCritical) return 'CLASSIC'
48
+
49
+ // Trade-offs detected → Let experts debate
50
+ if (ctx.hasTradeoffs || ctx.hasConflicts) return 'DEBATE'
51
+
52
+ // Complex new features → Guide with questions
53
+ if (ctx.changeType === 'new_feature' && ctx.complexity === 'high') return 'SOCRATIC'
54
+
55
+ // Simple reviews → Quick summaries
56
+ if (ctx.fileCount <= 3 && ctx.complexity === 'low') return 'SUMMARY'
57
+
58
+ // Default → Summary with expansion capability
59
+ return 'SUMMARY'
60
+ }
61
+ ```
62
+
63
+ ### Trade-off Detection Patterns
64
+
65
+ ```typescript
66
+ const TRADEOFF_SIGNALS = [
67
+ // Performance vs Readability
68
+ /useMemo|useCallback|React\.memo/,
69
+
70
+ // Security vs UX
71
+ /rate.?limit|captcha|2fa|mfa/,
72
+
73
+ // Flexibility vs Complexity
74
+ /generic|<T>|abstract|interface.*extends/,
75
+
76
+ // Consistency vs Speed
77
+ /cache|memoize|stale.?while/,
78
+
79
+ // DRY vs Explicit
80
+ /helper|util|shared|common/,
81
+ ]
82
+ ```
83
+
84
+ ### Transparency Announcement
85
+
86
+ Before executing, ALWAYS announce the chosen approach:
87
+
88
+ ```
89
+ ┌──────────────────────────────────────────────────────────────────┐
90
+ │ 📋 REVIEW APPROACH │
91
+ ├──────────────────────────────────────────────────────────────────┤
92
+ │ Files: {count} files, ~{lines} lines │
93
+ │ Domains: {domains} │
94
+ │ Criticality: {CRITICAL|NORMAL} │
95
+ │ │
96
+ │ {Reasoning for chosen style} │
97
+ │ │
98
+ │ Style: {SUMMARY|DEBATE|SOCRATIC|CLASSIC} │
99
+ │ Experts: {list} │
100
+ └──────────────────────────────────────────────────────────────────┘
101
+ ```
102
+
103
+ ### Adaptive Triggers
104
+
105
+ During the review, switch styles if:
106
+
107
+ | Trigger | New Style | Example |
108
+ |---------|-----------|---------|
109
+ | User asks "why?" or "explain" | Expand current expert | → Full analysis |
110
+ | Experts disagree | DEBATE | Security APPROVE, Perf REJECT |
111
+ | User seems confused | SOCRATIC | → Guide with questions |
112
+ | User says "just tell me" | SUMMARY | → Condensed output |
113
+
114
+ ---
115
+
28
116
  ## PHASE 1: PRE-ANALYSIS (Mandatory First Step)
29
117
 
30
118
  Before invoking ANY expert, complete these checks:
@@ -99,27 +187,68 @@ Launch selected experts in parallel using the Task tool.
99
187
 
100
188
  ### 2.1 Expert Invocation Template
101
189
 
102
- For EACH selected expert, invoke with this prompt structure:
190
+ For EACH selected expert, invoke with this **style-aware** prompt structure:
103
191
 
104
192
  ```
105
- You are the {EXPERT_NAME} reviewing these files: {FILE_LIST}
193
+ [EXPERT REVIEW]
194
+ Files: {FILE_LIST}
195
+ Criticality: {CRITICAL|NORMAL}
196
+ Context: {1-line description}
197
+ Change Type: {feature|bugfix|refactor}
198
+ Style: {SUMMARY|DEBATE|SOCRATIC|CLASSIC}
106
199
 
107
200
  MANDATORY: Follow the reasoning framework in _reasoning-framework.md
108
201
 
109
- FOR EACH FINDING:
110
- 1. OBSERVE: Quote exact code with file:line
111
- 2. STATE PREMISE: "IF [condition] THEN [consequence]"
112
- 3. VERIFY: Show what you searched and found
113
- 4. FALSIFY: Ask "What would make this NOT an issue?"
114
- 5. CONCLUDE: State confidence level and severity
202
+ {STYLE-SPECIFIC INSTRUCTIONS}
203
+ [END REVIEW]
204
+ ```
205
+
206
+ ### Style-Specific Instructions
115
207
 
116
- CONFIDENCE REQUIREMENTS:
117
- - CERTAIN: Direct observation, reproducible
118
- - HIGH: Pattern match + context verified
119
- - MEDIUM: Pattern match, some gaps
120
- - LOW: Inference only (cannot trigger REJECT)
208
+ | Style | Instructions Added to Prompt |
209
+ |-------|------------------------------|
210
+ | **SUMMARY** | "Provide a 2-3 sentence summary and your single most important finding. Save detailed analysis for expansion." |
211
+ | **DEBATE** | "State your position clearly. Other experts may disagree. Include reasoning for trade-offs. Be prepared to respond to counter-arguments." |
212
+ | **SOCRATIC** | "Instead of findings, generate 2-3 thought-provoking questions. Categories: clarify, challenge, explore, validate. Guide the developer to discover issues." |
213
+ | **CLASSIC** | "Full analysis with OBSERVE → PREMISE → VERIFY → FALSIFY → CONCLUDE. No shortcuts." |
214
+
215
+ ### Expected Output Per Style
216
+
217
+ ```typescript
218
+ // SUMMARY mode output
219
+ {
220
+ "expert": "{EXPERT_NAME}",
221
+ "vote": "APPROVE|REJECT|ABSTAIN",
222
+ "summary": "2-3 sentence summary",
223
+ "keyFinding": "Single most important finding",
224
+ "expandable": true,
225
+ "fullAnalysis": "...saved for expansion..."
226
+ }
227
+
228
+ // DEBATE mode output
229
+ {
230
+ "expert": "{EXPERT_NAME}",
231
+ "vote": "APPROVE|REJECT|ABSTAIN",
232
+ "position": "Your stance on the approach",
233
+ "stance": "agrees|disagrees|expands|questions",
234
+ "stanceTarget": "which expert (if responding)",
235
+ "reasoning": "Why you hold this position",
236
+ "tradeoff": "Performance vs Readability / Security vs UX etc"
237
+ }
238
+
239
+ // SOCRATIC mode output
240
+ {
241
+ "expert": "{EXPERT_NAME}",
242
+ "questions": [
243
+ {
244
+ "question": "What happens if...?",
245
+ "purpose": "challenge|clarify|explore|validate",
246
+ "options": ["Option A", "Option B", "Option C"]
247
+ }
248
+ ]
249
+ }
121
250
 
122
- OUTPUT FORMAT (JSON):
251
+ // CLASSIC mode output (original)
123
252
  {
124
253
  "expert": "{EXPERT_NAME}",
125
254
  "vote": "APPROVE|REJECT|ABSTAIN",