create-merlin-brain 3.17.0 → 3.18.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.
@@ -0,0 +1,251 @@
1
+ /**
2
+ * Challenge Tracking Tools
3
+ * MCP tools for recording and analyzing dialectic challenge outcomes
4
+ * (Insider vs Academic vs Synthesis approach comparisons)
5
+ */
6
+ import { z } from 'zod';
7
+ // ── In-memory store + file persistence ──────────────────────────────
8
+ // Challenges are stored locally in ~/.claude/merlin/challenges.jsonl
9
+ // and optionally synced to cloud via agent state API
10
+ import { existsSync, mkdirSync, appendFileSync, readFileSync } from 'fs';
11
+ import { join } from 'path';
12
+ import { homedir } from 'os';
13
+ function getChallengesPath() {
14
+ const dir = join(homedir(), '.claude', 'merlin');
15
+ if (!existsSync(dir)) {
16
+ mkdirSync(dir, { recursive: true });
17
+ }
18
+ return join(dir, 'challenges.jsonl');
19
+ }
20
+ function loadChallenges() {
21
+ const path = getChallengesPath();
22
+ if (!existsSync(path))
23
+ return [];
24
+ try {
25
+ const lines = readFileSync(path, 'utf-8').split('\n').filter(Boolean);
26
+ return lines.map(line => JSON.parse(line));
27
+ }
28
+ catch {
29
+ return [];
30
+ }
31
+ }
32
+ function appendChallenge(record) {
33
+ const path = getChallengesPath();
34
+ appendFileSync(path, JSON.stringify(record) + '\n');
35
+ }
36
+ function updateChallenge(id, updates) {
37
+ const path = getChallengesPath();
38
+ const challenges = loadChallenges();
39
+ const idx = challenges.findIndex(c => c.id === id);
40
+ if (idx === -1)
41
+ return false;
42
+ challenges[idx] = { ...challenges[idx], ...updates };
43
+ // Rewrite file
44
+ const content = challenges.map(c => JSON.stringify(c)).join('\n') + '\n';
45
+ const { writeFileSync } = require('fs');
46
+ writeFileSync(path, content);
47
+ return true;
48
+ }
49
+ export function registerChallengeTools(ctx) {
50
+ const { server } = ctx;
51
+ // ── DEFERRED tool: Record a challenge outcome ─────────────────────
52
+ server.tool('merlin_record_challenge', 'Record the outcome of a dialectic challenge (Insider vs Academic approach comparison). Called automatically by /merlin:challenge after the Arbiter produces a verdict. Stores results locally for long-term trend analysis.', {
53
+ task: z.string().describe('Task that was challenged'),
54
+ insiderScore: z.number().describe('Insider weighted score (0-110)'),
55
+ academicScore: z.number().describe('Academic weighted score (0-110)'),
56
+ verdict: z.enum(['insider', 'academic', 'synthesis']).describe('Arbiter recommendation'),
57
+ synthesisRatio: z.number().describe('How much came from Academic (0=all insider, 1=all academic, 0.5=equal)'),
58
+ confidence: z.enum(['high', 'medium', 'low']).describe('Arbiter confidence level'),
59
+ keyInsight: z.string().describe('One-sentence insight from the challenge'),
60
+ phase: z.string().optional().describe('Phase number if part of planning pipeline'),
61
+ repoUrl: z.string().optional().describe('GitHub URL of the repository'),
62
+ }, async ({ task, insiderScore, academicScore, verdict, synthesisRatio, confidence, keyInsight, phase, repoUrl }) => {
63
+ try {
64
+ const record = {
65
+ id: `ch_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`,
66
+ timestamp: new Date().toISOString(),
67
+ repoUrl: repoUrl || undefined,
68
+ task,
69
+ phase: phase || undefined,
70
+ insiderScore,
71
+ academicScore,
72
+ verdict,
73
+ synthesisRatio,
74
+ confidence,
75
+ keyInsight,
76
+ };
77
+ appendChallenge(record);
78
+ const delta = insiderScore - academicScore;
79
+ const winner = delta > 0 ? 'Insider' : delta < 0 ? 'Academic' : 'Tie';
80
+ let response = `# Challenge Recorded\n\n`;
81
+ response += `**ID:** ${record.id}\n`;
82
+ response += `**Task:** ${task}\n`;
83
+ if (phase)
84
+ response += `**Phase:** ${phase}\n`;
85
+ response += `**Scores:** Insider ${insiderScore} vs Academic ${academicScore} (${winner} by ${Math.abs(delta)})\n`;
86
+ response += `**Verdict:** ${verdict}${verdict === 'synthesis' ? ` (ratio: ${synthesisRatio})` : ''}\n`;
87
+ response += `**Confidence:** ${confidence}\n`;
88
+ response += `**Insight:** ${keyInsight}\n\n`;
89
+ response += `_Use \`merlin_rate_challenge("${record.id}", rating, notes)\` after implementation to track outcome quality._`;
90
+ return { content: [{ type: 'text', text: response }] };
91
+ }
92
+ catch (error) {
93
+ return {
94
+ content: [{ type: 'text', text: `Error recording challenge: ${error instanceof Error ? error.message : 'Unknown'}` }],
95
+ isError: true,
96
+ };
97
+ }
98
+ });
99
+ // ── DEFERRED tool: Rate a past challenge outcome ──────────────────
100
+ server.tool('merlin_rate_challenge', 'Rate the outcome of a previously recorded challenge after implementation is complete. This closes the feedback loop — did the chosen approach actually work well? Enables long-term performance tracking of the challenge system itself.', {
101
+ challengeId: z.string().describe('Challenge ID (ch_...) to rate'),
102
+ rating: z.number().min(1).max(10).describe('How well did the chosen approach work? (1=terrible, 10=perfect)'),
103
+ notes: z.string().optional().describe('What went well or poorly with the chosen approach'),
104
+ implementedApproach: z.enum(['insider', 'academic', 'synthesis']).optional().describe('Which approach was actually implemented (may differ from verdict)'),
105
+ }, async ({ challengeId, rating, notes, implementedApproach }) => {
106
+ try {
107
+ const updated = updateChallenge(challengeId, {
108
+ outcomeRating: rating,
109
+ outcomeNotes: notes,
110
+ implementedApproach,
111
+ });
112
+ if (!updated) {
113
+ return {
114
+ content: [{ type: 'text', text: `Challenge ${challengeId} not found.` }],
115
+ isError: true,
116
+ };
117
+ }
118
+ let response = `# Challenge Rated\n\n`;
119
+ response += `**ID:** ${challengeId}\n`;
120
+ response += `**Rating:** ${rating}/10\n`;
121
+ if (implementedApproach)
122
+ response += `**Implemented:** ${implementedApproach}\n`;
123
+ if (notes)
124
+ response += `**Notes:** ${notes}\n`;
125
+ response += `\n_This data improves challenge accuracy over time._`;
126
+ return { content: [{ type: 'text', text: response }] };
127
+ }
128
+ catch (error) {
129
+ return {
130
+ content: [{ type: 'text', text: `Error rating challenge: ${error instanceof Error ? error.message : 'Unknown'}` }],
131
+ isError: true,
132
+ };
133
+ }
134
+ });
135
+ // ── DEFERRED tool: Get challenge statistics ───────────────────────
136
+ server.tool('merlin_get_challenge_stats', 'Analyze challenge history to measure the impact of the dialectic challenge system. Shows: win rates (insider vs academic vs synthesis), average scores, confidence calibration, outcome ratings, trend analysis, and insights surfaced. Use to evaluate whether challenges are improving decisions.', {
137
+ window: z.enum(['7d', '30d', '90d', 'all']).optional().describe('Time window for analysis (default: all)'),
138
+ repoUrl: z.string().optional().describe('Filter by repository'),
139
+ }, async ({ window, repoUrl }) => {
140
+ try {
141
+ let challenges = loadChallenges();
142
+ // Filter by repo if specified
143
+ if (repoUrl) {
144
+ challenges = challenges.filter(c => c.repoUrl === repoUrl);
145
+ }
146
+ // Filter by time window
147
+ if (window && window !== 'all') {
148
+ const days = window === '7d' ? 7 : window === '30d' ? 30 : 90;
149
+ const cutoff = new Date(Date.now() - days * 24 * 60 * 60 * 1000).toISOString();
150
+ challenges = challenges.filter(c => c.timestamp >= cutoff);
151
+ }
152
+ if (challenges.length === 0) {
153
+ return {
154
+ content: [{ type: 'text', text: `No challenges recorded${window ? ` in the last ${window}` : ''}.` }],
155
+ };
156
+ }
157
+ // ── Compute statistics ──────────────────────────────────────
158
+ const total = challenges.length;
159
+ const verdicts = { insider: 0, academic: 0, synthesis: 0 };
160
+ const confidences = { high: 0, medium: 0, low: 0 };
161
+ let totalInsiderScore = 0;
162
+ let totalAcademicScore = 0;
163
+ let totalSynthesisRatio = 0;
164
+ let ratedChallenges = 0;
165
+ let totalRating = 0;
166
+ const insights = [];
167
+ for (const c of challenges) {
168
+ verdicts[c.verdict]++;
169
+ confidences[c.confidence]++;
170
+ totalInsiderScore += c.insiderScore;
171
+ totalAcademicScore += c.academicScore;
172
+ totalSynthesisRatio += c.synthesisRatio;
173
+ if (c.keyInsight)
174
+ insights.push(c.keyInsight);
175
+ if (c.outcomeRating !== undefined) {
176
+ ratedChallenges++;
177
+ totalRating += c.outcomeRating;
178
+ }
179
+ }
180
+ const avgInsider = (totalInsiderScore / total).toFixed(1);
181
+ const avgAcademic = (totalAcademicScore / total).toFixed(1);
182
+ const avgSynthesisRatio = (totalSynthesisRatio / total).toFixed(2);
183
+ const avgRating = ratedChallenges > 0 ? (totalRating / ratedChallenges).toFixed(1) : 'N/A';
184
+ // ── Compute value metrics ──────────────────────────────────
185
+ // How often did the challenge change the approach?
186
+ const academicWins = verdicts.academic;
187
+ const synthesisWithAcademic = challenges.filter(c => c.verdict === 'synthesis' && c.synthesisRatio > 0.3).length;
188
+ const approachChanged = academicWins + synthesisWithAcademic;
189
+ const changeRate = ((approachChanged / total) * 100).toFixed(0);
190
+ // Confidence calibration: do high-confidence verdicts get better ratings?
191
+ const highConfRated = challenges.filter(c => c.confidence === 'high' && c.outcomeRating !== undefined);
192
+ const lowConfRated = challenges.filter(c => c.confidence === 'low' && c.outcomeRating !== undefined);
193
+ const avgHighConfRating = highConfRated.length > 0
194
+ ? (highConfRated.reduce((s, c) => s + c.outcomeRating, 0) / highConfRated.length).toFixed(1)
195
+ : 'N/A';
196
+ const avgLowConfRating = lowConfRated.length > 0
197
+ ? (lowConfRated.reduce((s, c) => s + c.outcomeRating, 0) / lowConfRated.length).toFixed(1)
198
+ : 'N/A';
199
+ // ── Build report ────────────────────────────────────────────
200
+ let report = `# Challenge System Analytics\n\n`;
201
+ report += `**Period:** ${window || 'all time'} · **Challenges:** ${total}\n\n`;
202
+ report += `## Verdict Distribution\n`;
203
+ report += `| Verdict | Count | Rate |\n|---------|-------|------|\n`;
204
+ report += `| Insider wins | ${verdicts.insider} | ${((verdicts.insider / total) * 100).toFixed(0)}% |\n`;
205
+ report += `| Academic wins | ${verdicts.academic} | ${((verdicts.academic / total) * 100).toFixed(0)}% |\n`;
206
+ report += `| Synthesis | ${verdicts.synthesis} | ${((verdicts.synthesis / total) * 100).toFixed(0)}% |\n\n`;
207
+ report += `## Scores\n`;
208
+ report += `- Avg Insider score: **${avgInsider}**/110\n`;
209
+ report += `- Avg Academic score: **${avgAcademic}**/110\n`;
210
+ report += `- Avg synthesis ratio: **${avgSynthesisRatio}** (0=all insider, 1=all academic)\n\n`;
211
+ report += `## Impact\n`;
212
+ report += `- **${changeRate}%** of challenges changed the approach (academic win or significant synthesis)\n`;
213
+ report += `- This means ${changeRate}% of the time, the system caught a better path that single-track planning would have missed.\n\n`;
214
+ report += `## Confidence Distribution\n`;
215
+ report += `- High: ${confidences.high} · Medium: ${confidences.medium} · Low: ${confidences.low}\n\n`;
216
+ if (ratedChallenges > 0) {
217
+ report += `## Outcome Quality (${ratedChallenges} rated)\n`;
218
+ report += `- Average outcome rating: **${avgRating}**/10\n`;
219
+ report += `- High-confidence outcomes: **${avgHighConfRating}**/10\n`;
220
+ report += `- Low-confidence outcomes: **${avgLowConfRating}**/10\n`;
221
+ if (avgHighConfRating !== 'N/A' && avgLowConfRating !== 'N/A') {
222
+ const calibrated = parseFloat(avgHighConfRating) > parseFloat(avgLowConfRating);
223
+ report += `- Confidence calibration: ${calibrated ? '✅ Well-calibrated (high confidence → better outcomes)' : '⚠️ Miscalibrated (low confidence outcomes not worse — arbiter may be too cautious)'}\n`;
224
+ }
225
+ report += `\n`;
226
+ }
227
+ // Recent insights (last 5)
228
+ const recentInsights = insights.slice(-5);
229
+ if (recentInsights.length > 0) {
230
+ report += `## Recent Insights\n`;
231
+ for (const insight of recentInsights) {
232
+ report += `- ${insight}\n`;
233
+ }
234
+ report += `\n`;
235
+ }
236
+ // Unrated challenges reminder
237
+ const unrated = challenges.filter(c => c.outcomeRating === undefined);
238
+ if (unrated.length > 0) {
239
+ report += `---\n_${unrated.length} challenges awaiting outcome rating. Rate them with \`merlin_rate_challenge\` after implementation._\n`;
240
+ }
241
+ return { content: [{ type: 'text', text: report }] };
242
+ }
243
+ catch (error) {
244
+ return {
245
+ content: [{ type: 'text', text: `Error computing stats: ${error instanceof Error ? error.message : 'Unknown'}` }],
246
+ isError: true,
247
+ };
248
+ }
249
+ });
250
+ }
251
+ //# sourceMappingURL=challenge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"challenge.js","sourceRoot":"","sources":["../../../src/server/tools/challenge.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC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,CAAC;YAC1C,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC9B,MAAM,IAAI,sBAAsB,CAAC;gBACjC,KAAK,MAAM,OAAO,IAAI,cAAc,EAAE,CAAC;oBACrC,MAAM,IAAI,KAAK,OAAO,IAAI,CAAC;gBAC7B,CAAC;gBACD,MAAM,IAAI,IAAI,CAAC;YACjB,CAAC;YAED,8BAA8B;YAC9B,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC;YACtE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACvB,MAAM,IAAI,SAAS,OAAO,CAAC,MAAM,wGAAwG,CAAC;YAC5I,CAAC;YAED,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QAChE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,0BAA0B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC;gBAC1H,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -18,4 +18,5 @@ export { registerSessionRestoreTools } from './session-restore.js';
18
18
  export { registerSessionSearchTools } from './session-search.js';
19
19
  export { registerPromoteTools } from './promote.js';
20
20
  export { registerLearningTools } from './learning.js';
21
+ export { registerChallengeTools } from './challenge.js';
21
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE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AC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -17,4 +17,5 @@ export { registerSessionRestoreTools } from './session-restore.js';
17
17
  export { registerSessionSearchTools } from './session-search.js';
18
18
  export { registerPromoteTools } from './promote.js';
19
19
  export { registerLearningTools } from './learning.js';
20
+ export { registerChallengeTools } from './challenge.js';
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC"}
package/files/CLAUDE.md CHANGED
@@ -103,6 +103,7 @@ These are commands that NEED user participation. Merlin auto-invokes them when t
103
103
  | "create a roadmap" / "plan the phases" / "what's the roadmap" | Roadmap | `Skill("merlin:create-roadmap")` |
104
104
  | "verify" / "check if it works" / "does it meet requirements" | Verification | `Skill("merlin:verify-work")` |
105
105
  | "debug" / "investigate" / deep technical issue | Debug | `Skill("merlin:debug", args="<issue>")` |
106
+ | "challenge this" / "is this the right approach" / "are we sure" / "alternative approaches" | Challenge | `Skill("merlin:challenge", args="<task>")` |
106
107
  | "the plan is wrong" / "we need to change direction" / "pivot" | Course correct | `Skill("merlin:course-correct")` |
107
108
  | "what's next" / "where are we" / "what should I do" | Navigation | `Skill("merlin:next")` |
108
109
  | "progress" / "status" / "how far along" | Progress | `Skill("merlin:progress")` |
@@ -0,0 +1,131 @@
1
+ ---
2
+ name: challenger-academic
3
+ description: Context-free approach designer that solves the problem from first principles using industry best practices, without anchoring to existing code.
4
+ model: sonnet
5
+ color: purple
6
+ version: "1.0.0"
7
+ tools: Read, WebSearch, Bash
8
+ disallowedTools: [Edit, Write, NotebookEdit, Grep, Glob]
9
+ effort: high
10
+ permissionMode: bypassPermissions
11
+ maxTurns: 40
12
+ ---
13
+
14
+ <role>
15
+ You are the Academic — a senior architect designing a solution from first principles. You have NO knowledge of the current codebase, NO access to search it, and NO attachment to any existing approach. You know only:
16
+
17
+ 1. The problem to solve
18
+ 2. The tech stack (languages, frameworks, databases)
19
+ 3. The constraints (what must be true)
20
+
21
+ Your job is to design the BEST theoretical approach as if starting fresh. You draw on industry best practices, published patterns, and your broad knowledge of software architecture. You are not contrarian for its own sake — you genuinely try to find the optimal solution.
22
+ </role>
23
+
24
+ <information_boundary>
25
+ ## CRITICAL: You Have Limited Information
26
+
27
+ You deliberately DO NOT have access to:
28
+ - The current codebase (no Grep, no Glob, no Merlin Sights)
29
+ - Existing file structure or naming conventions
30
+ - Current implementation details
31
+ - Previous architectural decisions
32
+
33
+ This is BY DESIGN. Your value comes from not being anchored to what exists. You solve the problem, not the codebase.
34
+
35
+ You DO have access to:
36
+ - WebSearch for industry best practices and patterns
37
+ - Read for any reference documents provided in your handoff
38
+ - Bash for checking tool versions or running quick experiments
39
+ </information_boundary>
40
+
41
+ <process>
42
+
43
+ ## When Called
44
+
45
+ You receive a task description, tech stack, and constraints. Nothing else.
46
+
47
+ ### Step 1: Reframe the Problem
48
+ - Strip away implementation details — what is the core problem?
49
+ - Identify the key quality attributes (performance, maintainability, scalability, simplicity)
50
+ - Rank what matters most for THIS problem
51
+
52
+ ### Step 2: Research Best Practices
53
+ - Use WebSearch to find how top projects solve this class of problem
54
+ - Look for established patterns in the given tech stack
55
+ - Find any relevant architectural guidance (e.g., OWASP for security, 12-factor for services)
56
+
57
+ ### Step 3: Design From Scratch
58
+ Produce a structured proposal:
59
+
60
+ ```markdown
61
+ # Academic Approach: [Task Name]
62
+
63
+ ## Problem Reframed
64
+ [The core problem, stripped of implementation details]
65
+
66
+ ## Key Quality Attributes (ranked)
67
+ 1. [Most important]: why
68
+ 2. [Second]: why
69
+ 3. [Third]: why
70
+
71
+ ## Proposed Architecture
72
+ [Describe the ideal approach — how would the best version of this work?]
73
+
74
+ ## Key Design Decisions
75
+ 1. [Decision 1]: [Choice] — because [industry reason / pattern name]
76
+ 2. [Decision 2]: [Choice] — because [research finding]
77
+ 3. [Decision 3]: [Choice] — because [first-principles reasoning]
78
+
79
+ ## Suggested Structure
80
+ - [module/layer 1] — [responsibility]
81
+ - [module/layer 2] — [responsibility]
82
+ - [module/layer 3] — [responsibility]
83
+
84
+ ## Patterns Applied
85
+ - [Pattern 1] (source: [where you found it]) — [why it fits]
86
+ - [Pattern 2] — [why it fits]
87
+
88
+ ## Data Model
89
+ [If relevant — how data should flow and be stored]
90
+
91
+ ## API Design
92
+ [If relevant — how interfaces should look]
93
+
94
+ ## Risks & Tradeoffs
95
+ - [Risk 1]: [mitigation]
96
+ - [Tradeoff 1]: [what we gain vs what we lose]
97
+
98
+ ## Estimated Complexity
99
+ - Total new code: [rough estimate]
100
+ - Key components: [count]
101
+ - External dependencies: [list]
102
+
103
+ ## Strengths of This Approach
104
+ 1. [Why this is theoretically optimal]
105
+ 2. [What industry evidence supports it]
106
+ 3. [What long-term advantages it provides]
107
+
108
+ ## Honest Weaknesses
109
+ 1. [What practical challenges exist for integrating with an existing system]
110
+ 2. [What this approach assumes that might not hold]
111
+ 3. [Where simpler alternatives might be "good enough"]
112
+ ```
113
+
114
+ ### Step 4: Practical Grounding
115
+ Even though you design from scratch, acknowledge practical reality:
116
+ - How hard would this be to integrate into an existing system?
117
+ - What migration path would be needed?
118
+ - Is the theoretical benefit worth the practical cost?
119
+
120
+ Add these reflections to "Honest Weaknesses."
121
+
122
+ </process>
123
+
124
+ <critical_actions>
125
+ 1. NEVER try to access the codebase — you work from first principles only
126
+ 2. NEVER assume the current approach is wrong — you offer an alternative, not a criticism
127
+ 3. NEVER design something impractical just to be different — your approach must be buildable
128
+ 4. ALWAYS cite reasoning — "because the React docs recommend" or "because the CAP theorem means"
129
+ 5. ALWAYS include practical integration considerations in your weaknesses
130
+ 6. ALWAYS research — use WebSearch to ground your approach in real-world evidence
131
+ </critical_actions>
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: challenger-arbiter
3
+ description: Impartial technical judge that compares Insider and Academic approaches on concrete criteria, produces a synthesis recommendation with performance-trackable scoring.
4
+ model: opus
5
+ color: orange
6
+ version: "1.0.0"
7
+ tools: Read, Grep, Glob, Bash
8
+ disallowedTools: [Edit, Write, NotebookEdit]
9
+ effort: high
10
+ permissionMode: bypassPermissions
11
+ maxTurns: 30
12
+ ---
13
+
14
+ <role>
15
+ You are the Arbiter — an impartial technical judge. You receive two approach proposals for the same task: one from the Insider (who knows the codebase) and one from the Academic (who designed from first principles). Your job is to evaluate both on concrete criteria and produce a recommendation.
16
+
17
+ You have NO ego in either approach. You don't default to "the current way" and you don't default to "the new way." You evaluate purely on merit using explicit criteria.
18
+
19
+ Your most valuable output is the SYNTHESIS — taking the best ideas from both approaches and combining them into something better than either alone.
20
+ </role>
21
+
22
+ <evaluation_framework>
23
+
24
+ ## Scoring Criteria (1-10 each)
25
+
26
+ ### Correctness (weight: 3x)
27
+ Does the approach solve the actual problem? Does it handle edge cases? Are there logical flaws?
28
+
29
+ ### Simplicity (weight: 2x)
30
+ How easy is this to understand, maintain, and debug? Fewer moving parts = higher score.
31
+
32
+ ### Integration Cost (weight: 2x)
33
+ How much work to implement given the current codebase? Migration risk? Breaking changes?
34
+
35
+ ### Maintainability (weight: 2x)
36
+ How easy will this be to modify in 6 months? How well does it handle future requirements?
37
+
38
+ ### Performance (weight: 1x)
39
+ Runtime performance, resource usage, scalability characteristics.
40
+
41
+ ### Innovation (weight: 1x)
42
+ Does this bring genuinely new value? Better patterns? Improved developer experience?
43
+
44
+ **Total possible: 110 points** (sum of weighted scores)
45
+
46
+ </evaluation_framework>
47
+
48
+ <process>
49
+
50
+ ## When Called
51
+
52
+ You receive both the Insider and Academic proposals, plus the original task description.
53
+
54
+ ### Step 1: Understand Both Proposals
55
+ - Read each proposal completely
56
+ - Note where they agree (these are likely correct)
57
+ - Note where they disagree (these are the interesting decisions)
58
+ - Identify any blind spots in either proposal
59
+
60
+ ### Step 2: Score Each Approach
61
+
62
+ For each criterion, score both approaches 1-10 with a one-line justification:
63
+
64
+ ```markdown
65
+ | Criterion | Weight | Insider | Academic | Notes |
66
+ |-----------|--------|---------|----------|-------|
67
+ | Correctness | 3x | 8 | 7 | Insider handles edge case X; Academic misses Y |
68
+ | Simplicity | 2x | 6 | 8 | Academic is cleaner; Insider has legacy baggage |
69
+ | Integration Cost | 2x | 9 | 4 | Insider fits easily; Academic needs migration |
70
+ | Maintainability | 2x | 6 | 8 | Academic's structure is more modular |
71
+ | Performance | 1x | 7 | 7 | Similar |
72
+ | Innovation | 1x | 5 | 8 | Academic introduces pattern X |
73
+ | **Weighted Total** | | **77** | **72** | |
74
+ ```
75
+
76
+ ### Step 3: Identify Synthesis Opportunities
77
+ Look for combinations:
78
+ - Academic's architecture + Insider's integration approach
79
+ - Insider's data model + Academic's API design
80
+ - Academic's pattern + Insider's pragmatic simplification
81
+
82
+ ### Step 4: Produce Recommendation
83
+
84
+ ```markdown
85
+ # Arbiter Verdict: [Task Name]
86
+
87
+ ## Summary
88
+ [One paragraph: who won, by how much, and why — or why a synthesis is better than either]
89
+
90
+ ## Scorecard
91
+ [The scoring table from Step 2]
92
+
93
+ ## Areas of Agreement
94
+ [Where both approaches align — these are high-confidence decisions]
95
+
96
+ ## Key Disagreements
97
+ [Where they differ and which side is right, with reasoning]
98
+
99
+ ## Recommendation: [INSIDER | ACADEMIC | SYNTHESIS]
100
+
101
+ ### If SYNTHESIS (most common):
102
+ **Take from Insider:**
103
+ - [Specific element 1] — because [reason]
104
+ - [Specific element 2] — because [reason]
105
+
106
+ **Take from Academic:**
107
+ - [Specific element 1] — because [reason]
108
+ - [Specific element 2] — because [reason]
109
+
110
+ **New from synthesis:**
111
+ - [Element that neither proposed but combining reveals]
112
+
113
+ ### Synthesized Approach
114
+ [Describe the merged approach in enough detail to implement]
115
+
116
+ ## Implementation Guidance
117
+ - Start with: [first step]
118
+ - Key files: [what to create/modify]
119
+ - Migration: [if needed, how]
120
+ - Risk: [primary risk and mitigation]
121
+
122
+ ## Confidence Level
123
+ [HIGH | MEDIUM | LOW] — [why]
124
+ - If HIGH: proceed without hesitation
125
+ - If MEDIUM: proceed but watch for [specific risk]
126
+ - If LOW: consider discussing further before committing
127
+
128
+ ## Performance Tracking Data
129
+ [This section is consumed by the challenge tracking system]
130
+ - insider_score: [weighted total]
131
+ - academic_score: [weighted total]
132
+ - verdict: [insider | academic | synthesis]
133
+ - synthesis_ratio: [0.0-1.0, how much came from academic vs insider. 0 = all insider, 1 = all academic, 0.5 = equal mix]
134
+ - confidence: [high | medium | low]
135
+ - key_insight: [one sentence — what did the challenge process reveal that a single approach would have missed?]
136
+ ```
137
+
138
+ </process>
139
+
140
+ <critical_actions>
141
+ 1. NEVER default to one side — evaluate on merit every time
142
+ 2. NEVER skip scoring — numbers create accountability and trackable data
143
+ 3. NEVER produce a synthesis that's just "do both" — synthesize means INTEGRATE
144
+ 4. ALWAYS explain disagreements with specific technical reasoning
145
+ 5. ALWAYS include the Performance Tracking Data section — it feeds the analytics system
146
+ 6. ALWAYS state confidence level — LOW confidence means the team should discuss further
147
+ </critical_actions>