@recapt/mcp 0.0.4-beta → 0.0.6-beta

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.
package/package.json CHANGED
@@ -1,31 +1,37 @@
1
1
  {
2
2
  "name": "@recapt/mcp",
3
- "version": "0.0.4-beta",
3
+ "version": "0.0.6-beta",
4
4
  "description": "MCP exposing recapt behavioral intelligence to AI coding agents",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "type": "module",
8
8
  "scripts": {
9
- "build": "tsc",
9
+ "build": "npm run generate-catalog && tsc && cp src/tools/catalog/toolCatalog.json dist/tools/catalog/",
10
10
  "clean": "rimraf ./dist",
11
11
  "dev": "tsx --watch src/index.ts",
12
12
  "start": "node dist/index.js",
13
13
  "prettify": "prettier --write .",
14
- "type-check": "tsc --noEmit"
14
+ "type-check": "tsc --noEmit",
15
+ "generate-catalog": "tsx scripts/generateCatalog.ts"
15
16
  },
16
17
  "bin": {
17
- "recapt-mcp": "./dist/index.js"
18
+ "recapt-mcp": "./dist/index.js",
19
+ "recapt": "./dist/cli/index.js"
18
20
  },
19
21
  "files": [
20
- "dist"
22
+ "dist",
23
+ "skills"
21
24
  ],
22
-
23
25
  "author": "Recapt",
24
26
  "license": "ISC",
25
27
  "dependencies": {
26
28
  "@modelcontextprotocol/sdk": "^1.12.0",
29
+ "commander": "^14.0.3",
27
30
  "zod": "^3.24.0"
28
31
  },
32
+ "optionalDependencies": {
33
+ "@xenova/transformers": "^2.17.0"
34
+ },
29
35
  "peerDependencies": {
30
36
  "@types/node": "^24.3.1",
31
37
  "dotenv": "^17.2.2",
@@ -0,0 +1,92 @@
1
+ # Recapt Deep Dive Analysis
2
+
3
+ Use this workflow for comprehensive analysis of a specific page, flow, or user segment using recapt behavioral data.
4
+
5
+ ## When to Use
6
+
7
+ - User asks to analyze a specific page in depth
8
+ - User wants to understand why a page has poor metrics
9
+ - User asks "what's wrong with [page]?" or "why is [page] underperforming?"
10
+ - User wants a data-driven improvement strategy for a specific area
11
+
12
+ ## Workflow
13
+
14
+ ### 1. Establish Context
15
+
16
+ Start by understanding what you're analyzing:
17
+
18
+ - Search: "site overview" → `scan_site`, `list_pages`, `get_ux_health_report`
19
+ - Identify the target page(s) and their current health scores
20
+
21
+ ### 2. Page-Level Analysis
22
+
23
+ Gather comprehensive metrics for the target page:
24
+
25
+ - Search: "page analysis" → `get_page_metrics`
26
+ - Search: "element friction" → `get_element_friction`
27
+ - Search: "dead clicks" → `get_dead_clicks`
28
+ - Search: "console errors" → `get_console_errors`
29
+ - Search: "form friction" → `get_form_friction` (if page has forms)
30
+
31
+ ### 3. Flow Analysis
32
+
33
+ Understand how users arrive at and leave the page:
34
+
35
+ - Search: "user navigation" → `analyze_flow`, `get_journey_patterns`
36
+ - Search: "funnel" → `analyze_funnel`, `get_flow_friction`
37
+ - Identify where users come from and where they drop off
38
+
39
+ ### 4. Trend Analysis
40
+
41
+ Check if issues are new or long-standing:
42
+
43
+ - Search: "trends" → `get_page_trends`
44
+ - Search: "regressions" → `detect_regressions`
45
+ - Search: "anomalies" → `get_anomalies`
46
+
47
+ ### 5. Session Deep-Dive
48
+
49
+ Examine specific user sessions for qualitative insights:
50
+
51
+ - Search: "session details" → `search_sessions`, `list_sessions`, `get_session_details`
52
+ - Look for patterns in high-frustration or high-confusion sessions
53
+
54
+ ### 6. Segment Comparison
55
+
56
+ Compare different user groups:
57
+
58
+ - Search: "compare users" → `compare_cohorts`, `compare_periods`
59
+ - Search: "personas" → `discover_personas`
60
+ - Identify if issues affect all users or specific segments
61
+
62
+ ## Output Format
63
+
64
+ After gathering data, synthesize findings into:
65
+
66
+ 1. **Executive Summary** — 2-3 sentence overview of the page's health
67
+ 2. **Key Metrics** — Health score, frustration, confusion, confidence levels
68
+ 3. **Top Issues** — Prioritized list of problems with severity
69
+ 4. **User Flow Insights** — Where users come from, where they go, drop-off points
70
+ 5. **Recommendations** — Specific, actionable improvements ranked by impact
71
+
72
+ ## Tool Discovery Reference
73
+
74
+ | Analysis Type | Search Query | Tools |
75
+ | ------------- | ----------------------- | --------------------------------------------------------- |
76
+ | Overview | "site overview" | `scan_site`, `list_pages`, `get_ux_health_report` |
77
+ | Page metrics | "page analysis" | `get_page_metrics` |
78
+ | Elements | "element friction" | `get_element_friction`, `get_dead_clicks` |
79
+ | Errors | "console errors" | `get_console_errors` |
80
+ | Forms | "form friction" | `get_form_friction` |
81
+ | Navigation | "user navigation" | `analyze_flow`, `get_journey_patterns` |
82
+ | Funnels | "funnel" | `analyze_funnel`, `get_flow_friction` |
83
+ | Trends | "trends", "regressions" | `get_page_trends`, `detect_regressions`, `get_anomalies` |
84
+ | Sessions | "session details" | `search_sessions`, `list_sessions`, `get_session_details` |
85
+ | Segments | "compare users" | `compare_cohorts`, `compare_periods`, `discover_personas` |
86
+
87
+ ## Tips
88
+
89
+ - Use `memory_save` to store intermediate results when analysis spans many tools
90
+ - Start broad (site overview) then narrow down to specific issues
91
+ - Always check for console errors when frustration is high but confusion is low
92
+ - Compare mobile vs desktop cohorts — issues often differ by device
@@ -0,0 +1,120 @@
1
+ # Recapt Regression Hunt
2
+
3
+ Use this workflow to find and fix recent regressions — UX issues introduced by recent code changes.
4
+
5
+ ## When to Use
6
+
7
+ - User reports that something "broke" or "got worse"
8
+ - Metrics show a sudden spike in frustration or drop-off
9
+ - User asks to find what changed or what regressed
10
+ - After a deployment when users report issues
11
+
12
+ ## Workflow
13
+
14
+ ### 1. Detect Regressions
15
+
16
+ Start by identifying what regressed and when:
17
+
18
+ - Search: "regressions" → `detect_regressions`
19
+ - Search: "anomalies" → `get_anomalies`
20
+ - Search: "drift" → `detect_drift`
21
+
22
+ Look for:
23
+
24
+ - `spike_ratio` > 2: Critical regression, likely recent
25
+ - Sudden changes in frustration, confusion, or drop-off rates
26
+ - New console errors that weren't present before
27
+
28
+ ### 2. Establish Timeline
29
+
30
+ Narrow down when the regression started:
31
+
32
+ - Search: "trends" → `get_page_trends`
33
+ - Search: "compare periods" → `compare_periods`
34
+ - Compare metrics before and after the suspected change date
35
+
36
+ ### 3. Identify Affected Areas
37
+
38
+ Determine scope of the regression:
39
+
40
+ - Search: "page analysis" → `get_page_metrics`
41
+ - Search: "element friction" → `get_element_friction`
42
+ - Is it one page, one flow, or site-wide?
43
+
44
+ ### 4. Find Root Cause
45
+
46
+ Investigate the specific issue:
47
+
48
+ - Search: "console errors" → `get_console_errors` (often the culprit)
49
+ - Search: "dead clicks" → `get_dead_clicks` (broken interactions)
50
+ - Search: "investigate issue" → `investigate_issue`
51
+
52
+ ### 5. Examine Sessions
53
+
54
+ Look at specific user sessions during the regression period:
55
+
56
+ - Search: "session details" → `search_sessions`, `get_session_details`
57
+ - Filter for high-frustration sessions after the regression date
58
+ - Look for common patterns or error states
59
+
60
+ ### 6. Fix and Track
61
+
62
+ Once you've identified the cause:
63
+
64
+ - Implement the fix
65
+ - Search: "propose fix" → `propose_fix`
66
+ - Search: "deployment" → `confirm_deployment`
67
+ - Monitor with `evaluate_fix` after 24-48 hours
68
+
69
+ ## Regression Indicators
70
+
71
+ | Metric | Normal | Warning | Critical |
72
+ | ------------------ | ------ | --------- | -------- |
73
+ | spike_ratio | < 1.5 | 1.5 - 2.0 | > 2.0 |
74
+ | frustration delta | < 0.1 | 0.1 - 0.2 | > 0.2 |
75
+ | new console errors | 0 | 1-2 | 3+ |
76
+ | drop_off increase | < 5% | 5-15% | > 15% |
77
+
78
+ ## Common Regression Patterns
79
+
80
+ ### JavaScript Errors
81
+
82
+ - **Signal**: High frustration, low confusion, rage clicks on body/root
83
+ - **Search**: "console errors" → check for new errors
84
+ - **Fix**: Debug and fix the JS error
85
+
86
+ ### Broken Interactions
87
+
88
+ - **Signal**: Dead clicks on previously working elements
89
+ - **Search**: "dead clicks" → find non-responsive elements
90
+ - **Fix**: Check event handlers, z-index issues, or removed elements
91
+
92
+ ### Layout Shifts
93
+
94
+ - **Signal**: Misclicks, clicks on wrong elements
95
+ - **Search**: "element friction" → look for unexpected click targets
96
+ - **Fix**: Check CSS changes, loading states, or dynamic content
97
+
98
+ ### Performance Regression
99
+
100
+ - **Signal**: High abandonment, low engagement time
101
+ - **Search**: "session details" → check session durations
102
+ - **Fix**: Profile and optimize slow code paths
103
+
104
+ ## Tool Discovery Reference
105
+
106
+ | Phase | Search Query | Tools |
107
+ | ---------- | ------------------- | ---------------------------------------- |
108
+ | Detect | "regressions" | `detect_regressions` |
109
+ | Detect | "anomalies" | `get_anomalies` |
110
+ | Detect | "drift" | `detect_drift` |
111
+ | Timeline | "trends" | `get_page_trends` |
112
+ | Timeline | "compare periods" | `compare_periods` |
113
+ | Scope | "page analysis" | `get_page_metrics` |
114
+ | Scope | "element friction" | `get_element_friction` |
115
+ | Root cause | "console errors" | `get_console_errors` |
116
+ | Root cause | "dead clicks" | `get_dead_clicks` |
117
+ | Root cause | "investigate issue" | `investigate_issue` |
118
+ | Sessions | "session details" | `search_sessions`, `get_session_details` |
119
+ | Fix | "propose fix" | `propose_fix` |
120
+ | Track | "deployment" | `confirm_deployment`, `evaluate_fix` |
@@ -0,0 +1,95 @@
1
+ # Recapt Self-Healing Workflow
2
+
3
+ Use this workflow when asked to "fix issues", "heal the site", or improve UX based on behavioral data from recapt.
4
+
5
+ ## When to Use
6
+
7
+ - User asks to fix UX issues or friction points
8
+ - User wants to improve conversion or reduce drop-offs
9
+ - User asks to "heal" or "diagnose" their site
10
+ - After identifying issues with `run_full_diagnostic`
11
+
12
+ ## Workflow
13
+
14
+ ### 0. Check Pending Fixes (if returning)
15
+
16
+ Before diagnosing new issues, check if there are previously tracked fixes awaiting validation:
17
+
18
+ - Search: "pending fixes" → `list_pending_fixes`
19
+
20
+ If pending fixes exist:
21
+
22
+ 1. For each fix, call `evaluate_fix` to check validation status
23
+ 2. The tool will indicate if sufficient time has passed and enough sessions have interacted with the affected areas
24
+ 3. If data is insufficient, inform the user:
25
+
26
+ > "You have X fixes deployed Y hours ago. We need more session data (or more time) before we can validate their impact. Want to proceed with diagnosing new issues, or check back later?"
27
+
28
+ If fixes have sufficient data:
29
+
30
+ - Present the validation results (improved, no change, or regressed)
31
+ - Discuss next steps for any fixes that didn't improve metrics
32
+ - Then proceed to diagnose new issues
33
+
34
+ ### 1. Diagnose
35
+
36
+ Start with `run_full_diagnostic` (always available) to get a prioritized list of issues across the site.
37
+
38
+ ### 2. Investigate
39
+
40
+ For each high-priority issue, search for investigation tools:
41
+
42
+ - Search: "investigate issue" → `investigate_issue`, `validate_issue`
43
+ - This provides detailed context: affected sessions, element interactions, timing patterns
44
+
45
+ ### 3. Triage
46
+
47
+ Present findings to the user. Not all detected issues need fixing:
48
+
49
+ - Search: "dismiss issue" → `dismiss_issue`, `mark_intended_behavior`
50
+ - Some behaviors are intentional (e.g., rage clicks on a "copy" button)
51
+ - Ask the user which issues to address before proceeding
52
+
53
+ ### 4. Fix
54
+
55
+ Implement code changes to address the issues. After making changes:
56
+
57
+ - Search: "propose fix" → `propose_fix`, `get_similar_fixes`, `get_fix_history`
58
+ - Log the remediation so recapt can track its effectiveness
59
+
60
+ ### 5. Track
61
+
62
+ Mark fixes as deployed so recapt can measure impact:
63
+
64
+ - Search: "deployment" → `confirm_deployment`, `evaluate_fix`, `list_pending_fixes`
65
+
66
+ ### 6. Learn
67
+
68
+ Build site knowledge for future reference:
69
+
70
+ - Search: "site knowledge" → `get_site_knowledge`, `add_site_knowledge`
71
+ - Document patterns, intended behaviors, and architectural decisions
72
+
73
+ ## Post-Fix Behavior
74
+
75
+ After implementing fixes, always ask:
76
+
77
+ > "Fixes implemented. Want me to track these so we can validate the changes had a positive impact?"
78
+
79
+ If the user agrees:
80
+
81
+ 1. Use `confirm_deployment` to mark the fix as deployed
82
+ 2. Explain that recapt will monitor the affected pages/elements
83
+ 3. Suggest checking back in 24-48 hours with `evaluate_fix` to measure improvement
84
+
85
+ ## Tool Discovery Reference
86
+
87
+ | Phase | Search Query | Tools |
88
+ | ------------- | ------------------- | ---------------------------------------------------------- |
89
+ | Check Pending | "pending fixes" | `list_pending_fixes`, `evaluate_fix` |
90
+ | Diagnose | (always available) | `run_full_diagnostic` |
91
+ | Investigate | "investigate issue" | `investigate_issue`, `validate_issue` |
92
+ | Triage | "dismiss issue" | `dismiss_issue`, `mark_intended_behavior` |
93
+ | Fix | "propose fix" | `propose_fix`, `get_similar_fixes`, `get_fix_history` |
94
+ | Track | "deployment" | `confirm_deployment`, `evaluate_fix`, `list_pending_fixes` |
95
+ | Learn | "site knowledge" | `get_site_knowledge`, `add_site_knowledge` |