@torka/claude-workflows 0.7.1 → 0.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.
@@ -0,0 +1,495 @@
1
+ ---
2
+ description: 'Design-first UI story executor. Loads story, validates MCPs, implements visual-first approach with screenshot validation.'
3
+ ---
4
+
5
+ # Dev Story UI Workflow
6
+
7
+ Execute UI stories using a **design-first approach** with visual validation via Playwright.
8
+
9
+ **Usage**: `/dev-story-ui {story-identifier}`
10
+
11
+ ---
12
+
13
+ ## Step 1: Load Story & Validate
14
+
15
+ ```
16
+ 1. Parse story identifier (e.g., "3.2", "S3.2", "story-3.2", or story name)
17
+ 2. Read sprint-status.yaml to locate story path (or accept direct file path)
18
+ 3. Read and parse story file completely
19
+ 4. Extract:
20
+ - Tasks and subtasks (checkbox items)
21
+ - Acceptance criteria
22
+ - Dev Notes section
23
+ - Design references (MagicPatterns links, Figma, screenshots)
24
+ 5. VALIDATE: Story file exists and has required sections (Tasks, Acceptance Criteria)
25
+ - If missing → OUTPUT: "ERROR: Story file missing or invalid. Path: {path}"
26
+ - HALT
27
+ ```
28
+
29
+ ---
30
+
31
+ ## Step 2: MCP Availability Protocol
32
+
33
+ **PROBE for required MCPs based on story content:**
34
+
35
+ ### 2.1 Parse Story for Component Mentions
36
+
37
+ Scan story content (tasks, dev notes, acceptance criteria) for:
38
+ - `MagicPatterns` or `magicpatterns.com` link → REQUIRE MagicPatterns MCP
39
+ - `ShadCN` or `shadcn` or component names (Button, Card, etc.) → REQUIRE shadcn MCP
40
+ - No component guidance → DEFAULT to shadcn MCP (assume UI stories need it)
41
+
42
+ ### 2.2 Required MCPs for UI Stories
43
+
44
+ | MCP | Purpose | Probe Command |
45
+ |-----|---------|---------------|
46
+ | shadcn | Component library | `mcp__shadcn__get_project_registries({})` |
47
+ | Playwright | Visual validation | `mcp__playwright__playwright_navigate({ url: "about:blank" })` |
48
+
49
+ ### 2.3 Optional MCPs (graceful degradation)
50
+
51
+ | MCP | Purpose | Fallback |
52
+ |-----|---------|----------|
53
+ | Context7 | Library docs | Web search |
54
+ | MagicPatterns | Design code fetch | Manual implementation from design |
55
+
56
+ ### 2.4 Probe Execution
57
+
58
+ ```
59
+ FOR EACH required MCP:
60
+ 1. Call probe command
61
+ 2. IF error or unavailable:
62
+ - OUTPUT: "ESCALATE: Required MCP '{name}' not available"
63
+ - OUTPUT: "Suggested action: Enable {name} MCP in Claude settings"
64
+ - HALT immediately
65
+ 3. IF available:
66
+ - Log: "MCP {name}: available"
67
+
68
+ Document in Dev Agent Record:
69
+ - Available MCPs: [list]
70
+ - Unavailable (optional): [list with fallback notes]
71
+ ```
72
+
73
+ ---
74
+
75
+ ## Step 3: Load Project Context
76
+
77
+ ```
78
+ 1. Check for docs/project-context.md or project-context.md
79
+ 2. IF exists:
80
+ - Read and extract: coding standards, patterns, conventions
81
+ - Note project-specific rules for implementation
82
+ 3. Check Dev Notes for architecture/tech-spec references
83
+ 4. Load referenced documents for context
84
+ 5. This context applies to ALL implementation decisions
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Step 4: Detect Restart or Review Continuation
90
+
91
+ ### 4.1 Check for Incomplete Story
92
+
93
+ ```
94
+ 1. Scan all Tasks and Subtasks for checkbox status
95
+ 2. Count: completed [x] vs incomplete [ ]
96
+ 3. IF mix of completed/incomplete:
97
+ - This is a RESTART
98
+ - Find FIRST incomplete task → resume from there
99
+ - Log: "RESTART: Resuming from task {X.Y}"
100
+ 4. IF all incomplete:
101
+ - This is a FRESH START
102
+ - Log: "FRESH START: Beginning implementation"
103
+ ```
104
+
105
+ ### 4.2 Check for Review Feedback
106
+
107
+ ```
108
+ 1. Search story file for these sections:
109
+ - "Desk Check Feedback" or "Desk Check Review"
110
+ - "Senior Developer Review (AI)" or "Code Review"
111
+ - "Design Review"
112
+ - "Review Follow-ups (AI)"
113
+
114
+ 2. IF review section exists:
115
+ - Parse for unresolved items (unchecked boxes, open issues)
116
+ - IF unresolved items found:
117
+ - Log: "Acting on {review-type} feedback"
118
+ - Prioritize fixing review items BEFORE new implementation
119
+ - Create mental task list from review items
120
+ 3. IF no review section or all resolved:
121
+ - Proceed with normal implementation
122
+ ```
123
+
124
+ ### 4.3 Document Status
125
+
126
+ ```
127
+ Dev Agent Record update:
128
+ - Execution type: "Restart from task X.Y" | "Fresh start"
129
+ - Review action: "Acting on {type} feedback" | "No pending reviews"
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Step 5: Mark Story In-Progress
135
+
136
+ ```
137
+ 1. Read current status from story file
138
+ 2. IF status is "ready-for-dev" or "Draft":
139
+ - Update sprint-status.yaml → set story status to "in-progress"
140
+ - Update story file Status field → "in-progress"
141
+ - Log: "Status updated: in-progress"
142
+ 3. IF status already "in-progress":
143
+ - This is a restart, no update needed
144
+ - Log: "Status unchanged (restart)"
145
+ 4. IF no sprint-status.yaml:
146
+ - Note: "No sprint tracking file found"
147
+ - Continue without sprint updates
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Step 6: Design Analysis
153
+
154
+ ```
155
+ 1. Extract design references from story:
156
+ - MagicPatterns links
157
+ - Figma links
158
+ - Screenshot paths
159
+ - Component specifications in Dev Notes
160
+
161
+ 2. IF MagicPatterns link provided:
162
+ - CRITICAL: Fetch code via MCP (NEVER build from scratch)
163
+ - Adapt for project structure
164
+
165
+ 3. IF shadcn components needed:
166
+ - Call mcp__shadcn__search_items_in_registries for relevant components
167
+ - Note component names for implementation
168
+
169
+ 4. Document design decisions:
170
+ - Components to use
171
+ - Styling approach
172
+ - Layout patterns
173
+
174
+ 5. Log design analysis in Dev Agent Record
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Step 7: Implement Visual First (Per Task)
180
+
181
+ **FOR EACH task/subtask (starting from first incomplete):**
182
+
183
+ ### 7.1 MagicPatterns Implementation
184
+
185
+ ```
186
+ IF MagicPatterns link provided for this task:
187
+ 1. Fetch code via MCP
188
+ 2. Adapt for project:
189
+ - Update imports to match project structure
190
+ - Apply project's Tailwind config/CSS variables
191
+ - Integrate with project's patterns
192
+ 3. Preserve design intent from MagicPatterns
193
+ ```
194
+
195
+ ### 7.2 ShadCN Component Implementation
196
+
197
+ ```
198
+ IF using shadcn components:
199
+ 1. ALWAYS call mcp__shadcn__get_item_examples_from_registries FIRST
200
+ - Query: "{component-name}-demo" or "{component-name} example"
201
+ 2. Review demo output:
202
+ - Available variants, sizes, props
203
+ - Required imports
204
+ - Composition patterns
205
+ 3. Implement following EXACT patterns from demo
206
+ 4. NEVER guess component APIs
207
+ ```
208
+
209
+ ### 7.3 Build UI
210
+
211
+ ```
212
+ 1. Create/modify component files
213
+ 2. Focus on visual fidelity FIRST
214
+ 3. Use semantic HTML
215
+ 4. Apply consistent styling (Tailwind classes)
216
+ 5. Ensure accessibility basics (alt text, labels, ARIA)
217
+ ```
218
+
219
+ ---
220
+
221
+ ## Step 8: Visual Validation Loop
222
+
223
+ **FOR EACH page/route affected:**
224
+
225
+ ```
226
+ 1. Ensure dev server running:
227
+ - Check if http://localhost:3000 accessible
228
+ - IF not: Run `npm run dev` and wait for ready
229
+
230
+ 2. Navigate to affected page:
231
+ mcp__playwright__playwright_navigate({ url: "http://localhost:3000/{route}" })
232
+
233
+ 3. Take screenshot:
234
+ mcp__playwright__playwright_screenshot({
235
+ name: "{page-name}-{timestamp}",
236
+ fullPage: true
237
+ })
238
+
239
+ 4. Check console for errors:
240
+ mcp__playwright__playwright_console_logs({ type: "error" })
241
+
242
+ 5. Analyze results:
243
+ - Compare screenshot against design intent
244
+ - Review any console errors
245
+
246
+ 6. IF issues found:
247
+ - Fix the issue
248
+ - Repeat steps 2-5
249
+ - MAX 3 iterations per issue
250
+
251
+ 7. IF still issues after 3 iterations:
252
+ - Document limitation in Dev Agent Record
253
+ - Continue to next task (don't block indefinitely)
254
+
255
+ 8. Document in Dev Agent Record:
256
+ - Screenshot paths captured
257
+ - Console output (errors if any)
258
+ - Limitations noted
259
+ ```
260
+
261
+ ---
262
+
263
+ ## Step 9: Add Behavioral Tests
264
+
265
+ ```
266
+ Now that UI is visually correct, add tests:
267
+
268
+ 1. E2E Tests (Playwright):
269
+ - Test critical user flows (click, navigate, submit)
270
+ - Test error states and edge cases
271
+ - Test responsive behavior if applicable
272
+ - Location: tests/{feature}.spec.ts
273
+
274
+ 2. Unit Tests (if business logic exists):
275
+ - Component prop validation
276
+ - State management logic
277
+ - Utility functions
278
+ - Location: co-located with component (Component.test.tsx)
279
+
280
+ 3. Run full test suite:
281
+ npm test
282
+ npm run test:e2e (if available)
283
+
284
+ 4. Ensure all tests pass before marking task complete
285
+ ```
286
+
287
+ ---
288
+
289
+ ## Step 10: Validate & Mark Task Complete
290
+
291
+ **FOR EACH task:**
292
+
293
+ ### Validation Gates (ALL must pass)
294
+
295
+ ```
296
+ - [ ] Visual output matches design intent (screenshot reviewed)
297
+ - [ ] Console shows no errors from changed code
298
+ - [ ] Tests exist for the functionality
299
+ - [ ] Tests pass 100%
300
+ - [ ] Acceptance criteria for this task satisfied
301
+ ```
302
+
303
+ ### IF ALL GATES PASS:
304
+
305
+ ```
306
+ 1. IMMEDIATELY edit story file:
307
+ - Change task checkbox from [ ] to [x]
308
+ - Save the file
309
+
310
+ 2. Update File List section in story:
311
+ - Add any new/modified files
312
+
313
+ 3. Add note to Dev Agent Record → Debug Log:
314
+ - "{timestamp}: Task X.Y completed - {brief summary}"
315
+
316
+ 4. IF this was a review follow-up task:
317
+ - Mark corresponding review item as resolved
318
+
319
+ 5. Proceed to next incomplete task (or Step 11 if all done)
320
+ ```
321
+
322
+ ### IF GATES FAIL:
323
+
324
+ ```
325
+ 1. Document failure reason in Debug Log
326
+ 2. Attempt to fix (max 3 tries per issue)
327
+ 3. IF cannot resolve after 3 tries:
328
+ - Document blocker clearly
329
+ - HALT with status: blocked
330
+ - Output blocker details for user
331
+ ```
332
+
333
+ ---
334
+
335
+ ## Step 11: Story Completion & Summary
336
+
337
+ ### 11.1 Final Verification
338
+
339
+ ```
340
+ 1. Re-scan story file for any unmarked tasks
341
+ 2. IF any [ ] tasks remain:
342
+ - Return to Step 7 for those tasks
343
+ - Do NOT proceed until all [x]
344
+
345
+ 3. Run full regression suite:
346
+ npm test
347
+ npm run test:e2e
348
+
349
+ 4. Verify ALL tests pass
350
+ ```
351
+
352
+ ### 11.2 Execute Definition of Done Checklist
353
+
354
+ ```
355
+ ## UI Story DoD Checklist
356
+
357
+ ### Visual Validation
358
+ - [ ] Visual output matches design intent
359
+ - [ ] Screenshot captured and reviewed
360
+ - [ ] Console shows no JS errors from changed code
361
+ - [ ] Responsive behavior verified (if applicable)
362
+
363
+ ### Component Library
364
+ - [ ] Used component library (shadcn/MagicPatterns) - NOT built from scratch
365
+ - [ ] Component APIs verified via demos before implementation
366
+
367
+ ### Implementation
368
+ - [ ] All tasks/subtasks marked [x]
369
+ - [ ] Implementation matches acceptance criteria
370
+ - [ ] No scope creep (only implemented what was specified)
371
+
372
+ ### Testing
373
+ - [ ] E2E tests for critical user flows
374
+ - [ ] Unit tests for business logic (if applicable)
375
+ - [ ] All tests pass
376
+
377
+ ### Documentation
378
+ - [ ] File List updated in story
379
+ - [ ] Completion Notes written (see below)
380
+ - [ ] Change Log updated (if exists)
381
+ - [ ] Status set to "review"
382
+
383
+ FOR EACH unchecked item:
384
+ - Fix the issue
385
+ - Re-run validation
386
+ ```
387
+
388
+ ### 11.3 Write Completion Notes
389
+
390
+ ```
391
+ Add to Dev Agent Record or story file:
392
+
393
+ ## Completion Notes
394
+
395
+ **Summary**: [1-2 sentence description of what was built]
396
+
397
+ **Key Decisions**:
398
+ - [Decision 1 and rationale]
399
+ - [Decision 2 and rationale]
400
+
401
+ **Components Used**:
402
+ - [shadcn/MagicPatterns components added]
403
+
404
+ **Known Limitations** (if any):
405
+ - [Any compromises or TODOs for future]
406
+
407
+ **Testing**:
408
+ - [Test types added: E2E, unit, etc.]
409
+ - [Test count and pass rate]
410
+ ```
411
+
412
+ ### 11.4 Update Status
413
+
414
+ ```
415
+ 1. Update story file Status → "review"
416
+ 2. Update sprint-status.yaml → set story status to "review"
417
+ 3. Log: "Story completed, status: review"
418
+ ```
419
+
420
+ ---
421
+
422
+ ## Step 12: Completion Handoff
423
+
424
+ **Output this structured handoff:**
425
+
426
+ ```
427
+ === AGENT HANDOFF ===
428
+ agent: {agent-name}
429
+ story: [story number, e.g., "3.2"]
430
+ status: completed | failed | blocked
431
+ files_changed:
432
+ - [list all modified/created files]
433
+ visual_validation:
434
+ screenshots: [list screenshot paths]
435
+ console_errors: none | [list errors]
436
+ tests_passed: true | false
437
+ tests_run: [count]
438
+ dod_checklist: passed | failed
439
+ completion_notes: written | skipped
440
+ blockers: none | [list blockers]
441
+ next_action: proceed | fix_required | escalate
442
+ === END HANDOFF ===
443
+ ```
444
+
445
+ **Status Definitions:**
446
+ - `completed`: All tasks done, DoD passed, ready for review
447
+ - `failed`: Errors encountered that could not be resolved
448
+ - `blocked`: External dependency prevents completion (missing MCP, unclear requirements)
449
+
450
+ **Next Action:**
451
+ - `proceed`: Story ready for code review / quality gate
452
+ - `fix_required`: Minor issues need attention
453
+ - `escalate`: Requires human intervention
454
+
455
+ ---
456
+
457
+ ## MCP Best Practices Reference
458
+
459
+ ### shadcn MCP
460
+
461
+ ```
462
+ 1. mcp__shadcn__get_project_registries({}) - Verify setup
463
+ 2. mcp__shadcn__search_items_in_registries({ registries: ["@shadcn"], query: "{term}" }) - Find components
464
+ 3. mcp__shadcn__get_item_examples_from_registries({ registries: ["@shadcn"], query: "{name}-demo" }) - ALWAYS call before implementing
465
+ 4. mcp__shadcn__get_add_command_for_items({ items: ["@shadcn/{name}"] }) - Get install command
466
+ 5. mcp__shadcn__get_audit_checklist({}) - Run after adding components
467
+ ```
468
+
469
+ ### Playwright MCP
470
+
471
+ ```
472
+ 1. mcp__playwright__playwright_navigate({ url: "..." }) - Navigate to page
473
+ 2. mcp__playwright__playwright_screenshot({ name: "...", fullPage: true }) - Capture for validation
474
+ 3. mcp__playwright__playwright_console_logs({ type: "error" }) - Check for JS errors
475
+ 4. mcp__playwright__playwright_get_visible_html({}) - Inspect DOM
476
+ 5. mcp__playwright__playwright_close({}) - Clean up when done
477
+ ```
478
+
479
+ ### MagicPatterns MCP
480
+
481
+ ```
482
+ 1. NEVER build from scratch when MagicPatterns link provided
483
+ 2. Fetch generated code via MCP
484
+ 3. Adapt for project: imports, styling tokens, component structure
485
+ 4. Preserve design intent, adapt implementation details
486
+ ```
487
+
488
+ ### Context7 MCP
489
+
490
+ ```
491
+ 1. mcp__context7__resolve-library-id({ libraryName: "...", query: "..." }) - Get library ID first
492
+ 2. mcp__context7__query-docs({ libraryId: "...", query: "..." }) - Query specific patterns
493
+ 3. Limit to 3 calls per question
494
+ 4. Fallback: Use WebSearch if unavailable
495
+ ```
package/install.js CHANGED
@@ -2,6 +2,11 @@
2
2
  /**
3
3
  * @torka/claude-workflows - Post-install script
4
4
  * Copies workflow files to the appropriate .claude directory
5
+ *
6
+ * Behavior: Always syncs files from the package (overwrites if different)
7
+ * - New files are copied
8
+ * - Existing files are updated if content differs (backup created)
9
+ * - Identical files are skipped (no-op)
5
10
  */
6
11
 
7
12
  const fs = require('fs');
@@ -14,6 +19,7 @@ const colors = {
14
19
  yellow: '\x1b[33m',
15
20
  blue: '\x1b[34m',
16
21
  red: '\x1b[31m',
22
+ cyan: '\x1b[36m',
17
23
  reset: '\x1b[0m',
18
24
  bold: '\x1b[1m',
19
25
  };
@@ -26,6 +32,14 @@ function logSuccess(message) {
26
32
  log(` ✓ ${message}`, 'green');
27
33
  }
28
34
 
35
+ function logUpdate(message) {
36
+ log(` ↻ ${message}`, 'cyan');
37
+ }
38
+
39
+ function logBackup(message) {
40
+ log(` ⤷ ${message}`, 'yellow');
41
+ }
42
+
29
43
  function logSkip(message) {
30
44
  log(` ○ ${message}`, 'yellow');
31
45
  }
@@ -73,6 +87,9 @@ function getTargetBase() {
73
87
 
74
88
  /**
75
89
  * Recursively copy directory contents
90
+ * - New files: copied
91
+ * - Changed files: backed up (.backup), then updated
92
+ * - Identical files: skipped
76
93
  */
77
94
  function copyDirRecursive(src, dest, stats) {
78
95
  if (!fs.existsSync(src)) {
@@ -94,9 +111,27 @@ function copyDirRecursive(src, dest, stats) {
94
111
  copyDirRecursive(srcPath, destPath, stats);
95
112
  } else {
96
113
  if (fs.existsSync(destPath)) {
97
- stats.skipped.push(destPath);
98
- logSkip(`Skipped (exists): ${path.relative(stats.targetBase, destPath)}`);
114
+ // File exists - check if content differs
115
+ const srcContent = fs.readFileSync(srcPath);
116
+ const destContent = fs.readFileSync(destPath);
117
+
118
+ if (srcContent.equals(destContent)) {
119
+ // Identical - skip
120
+ stats.unchanged.push(destPath);
121
+ logSkip(`Unchanged: ${path.relative(stats.targetBase, destPath)}`);
122
+ } else {
123
+ // Different - backup existing file, then update
124
+ const backupPath = destPath + '.backup';
125
+ fs.copyFileSync(destPath, backupPath);
126
+ stats.backups.push(backupPath);
127
+ logBackup(`Backup: ${path.relative(stats.targetBase, backupPath)}`);
128
+
129
+ fs.copyFileSync(srcPath, destPath);
130
+ stats.updated.push(destPath);
131
+ logUpdate(`Updated: ${path.relative(stats.targetBase, destPath)}`);
132
+ }
99
133
  } else {
134
+ // New file - copy
100
135
  fs.copyFileSync(srcPath, destPath);
101
136
  stats.copied.push(destPath);
102
137
  logSuccess(`Copied: ${path.relative(stats.targetBase, destPath)}`);
@@ -124,7 +159,9 @@ function install() {
124
159
 
125
160
  const stats = {
126
161
  copied: [],
127
- skipped: [],
162
+ updated: [],
163
+ unchanged: [],
164
+ backups: [],
128
165
  targetBase,
129
166
  };
130
167
 
@@ -154,13 +191,18 @@ function install() {
154
191
 
155
192
  // Summary
156
193
  log('\n' + colors.bold + '📊 Installation Summary' + colors.reset);
157
- log(` Files copied: ${stats.copied.length}`, 'green');
158
- log(` Files skipped (already exist): ${stats.skipped.length}`, 'yellow');
194
+ log(` Files copied (new): ${stats.copied.length}`, 'green');
195
+ log(` Files updated: ${stats.updated.length}`, 'cyan');
196
+ log(` Files unchanged: ${stats.unchanged.length}`, 'yellow');
197
+ if (stats.backups.length > 0) {
198
+ log(` Backups created: ${stats.backups.length} (*.backup files)`, 'yellow');
199
+ }
159
200
 
160
201
  // Post-install instructions
161
202
  log('\n' + colors.bold + '📝 Next Steps' + colors.reset);
162
203
  log(' 1. Run /git-cleanup-and-merge or /plan-parallelization to test');
163
- log(' 2. Try /designer-founder for UI/UX design workflows\n');
204
+ log(' 2. Try /designer-founder for UI/UX design workflows');
205
+ log(' 3. Use /dev-story-ui, /dev-story-backend, or /dev-story-fullstack for story execution\n');
164
206
 
165
207
  // Note about BMAD dependencies
166
208
  log(colors.yellow + '⚠️ Note: Some components work better with BMAD Method installed:' + colors.reset);
@@ -170,8 +212,10 @@ function install() {
170
212
  log(' ✓ git-cleanup-and-merge');
171
213
  log(' ✓ plan-parallelization');
172
214
  log(' ✓ implement-epic-with-subagents (workflow files included)');
173
- log(' ✓ agent-creator skill');
174
- log(' ✓ designer-founder skill\n');
215
+ log(' ✓ dev-story-ui, dev-story-backend, dev-story-fullstack');
216
+ log(' ✓ agent-creator skill (with expertise profiles)');
217
+ log(' ✓ designer-founder skill');
218
+ log(' ✓ desk-check-gate agent\n');
175
219
  }
176
220
 
177
221
  // Run installation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@torka/claude-workflows",
3
- "version": "0.7.1",
3
+ "version": "0.9.0",
4
4
  "description": "Claude Code workflow helpers: epic automation, git cleanup, agents, and design workflows",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -210,3 +210,75 @@ gh search repos "claude subagent" --sort updated --limit 5
210
210
  ### Community
211
211
  - Anthropic Discord: https://discord.gg/anthropic
212
212
  - GitHub Discussions: https://github.com/anthropics/claude-code/discussions
213
+
214
+ ---
215
+
216
+ ## Research Questions Framework
217
+
218
+ When researching agent patterns, answer these 5 questions to extract actionable insights:
219
+
220
+ ### 1. What problem does this agent solve?
221
+ - What task or workflow does it automate?
222
+ - What pain point does it address?
223
+ - Is this problem relevant to your project?
224
+
225
+ ### 2. What expertise does it encode?
226
+ - What domain knowledge is embedded?
227
+ - What decisions does it make automatically?
228
+ - What best practices does it enforce?
229
+
230
+ ### 3. What patterns can be reused?
231
+ - Prompt structure and persona design
232
+ - Tool selection and restrictions
233
+ - Workflow steps and checkpoints
234
+
235
+ ### 4. What limitations does it have?
236
+ - What scenarios does it NOT handle?
237
+ - What assumptions does it make?
238
+ - Where might it fail in your context?
239
+
240
+ ### 5. How should it be adapted?
241
+ - What project-specific changes are needed?
242
+ - What tools/MCPs should be added/removed?
243
+ - What workflow steps need modification?
244
+
245
+ ---
246
+
247
+ ## Expertise Extraction Guide
248
+
249
+ When reviewing a repository or agent definition, extract these elements:
250
+
251
+ | Element | What to Look For | How to Use It |
252
+ |---------|------------------|---------------|
253
+ | **Keywords** | Words in description that trigger the agent | Add to your agent's description |
254
+ | **Competencies** | Skills/knowledge areas mentioned | Include in persona section |
255
+ | **Tool Selection** | Which tools are allowed/restricted | Match to your MCP availability |
256
+ | **Workflow Steps** | Sequence of actions the agent follows | Adapt for your workflow |
257
+ | **Quality Checks** | Validation or verification steps | Include in agent instructions |
258
+ | **Anti-Patterns** | Things the agent explicitly avoids | Add as "You avoid" section |
259
+ | **Output Format** | How results are structured | Match your project conventions |
260
+
261
+ ### Quick Extraction Checklist
262
+
263
+ For each repo/agent reviewed, note:
264
+
265
+ ```markdown
266
+ ## Agent: {name}
267
+ **Source**: {repo URL}
268
+ **Relevance**: {1-5 score}
269
+
270
+ ### Extracted Elements
271
+ - **Keywords**: {trigger words}
272
+ - **Core Skill**: {main competency}
273
+ - **Tool Pattern**: {tools used/restricted}
274
+ - **Key Insight**: {most useful pattern}
275
+ - **Adaptation Needed**: {what to change}
276
+ ```
277
+
278
+ ### When to Stop Researching
279
+
280
+ Stop research and proceed when ANY of these are true:
281
+ - Found 2+ relevant patterns that can be combined
282
+ - Hit research limits (3 repo searches, 5 repo evaluations, 2 web searches)
283
+ - 10 minutes elapsed
284
+ - Pre-built expertise profile covers 80%+ of needs