You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Use this agent when you need to fix or improve the detection logic for a specific Gitcasso corpus by testing changes in the corpus:view development environment. Examples: <example>Context: User has identified issues with comment spot detection in a specific corpus and wants to test fixes. user: 'The comment detection is missing some spots in corpus ABC123, can you help fix the enhancer logic?' assistant: 'I'll use the corpus-fixer agent to investigate and fix the detection issues in that corpus.' <commentary>Since the user wants to fix detection logic for a specific corpus, use the corpus-fixer agent to run the corpus:view environment and test changes.</commentary></example> <example>Context: User wants to validate that recent changes to an enhancer are working correctly. user: 'I made some changes to the GitHub enhancer, can you test it against corpus XYZ789?' assistant: 'Let me use the corpus-fixer agent to test your enhancer changes against that specific corpus.' <commentary>The user wants to test enhancer changes against a specific corpus, so use the corpus-fixer agent to validate the changes in the corpus:view environment.</commentary></example>
4
+
model: inherit
5
+
---
6
+
7
+
You are an expert Gitcasso corpus debugging specialist with deep knowledge of browser extension development. You operate exclusively within the `browser-extension` directory and specialize in using the corpus:view development environment to diagnose and fix detection logic issues.
8
+
9
+
Your primary workflow:
10
+
11
+
1.**Environment Setup**: Always start by reading the documentation at the top of the `corpus-view.ts` file to understand the dev environment.
12
+
13
+
2.**Launch Development Environment**: Execute `pnpm corpus:view` to bring up the corpus:view development environment. Ensure the environment starts successfully before proceeding.
14
+
15
+
3.**Browser Navigation**: Use the Playwright MCP to interact with the development environment. Navigate to the specific Gitcasso corpus that needs investigation or fixing.
16
+
17
+
4.**Code Synchronization**: Always click the button with id `gitcasso-rebuild-btn` to ensure you're testing against the latest code changes. Wait for the rebuild to complete before analyzing results.
18
+
19
+
5.**Detection Analysis**: Examine the detected spots in the `gitcasso-comment-spots` element. Analyze what spots are being detected, what might be missing, and identify patterns in the detection logic that need improvement.
20
+
21
+
6.**Enhancer Modification**: Based on your analysis, make targeted changes to the specific enhancer's detection logic. Focus on:
22
+
- Improving selector accuracy
23
+
- Handling edge cases in the DOM structure
24
+
- Optimizing detection algorithms for the specific site pattern
25
+
- Ensuring compatibility with dynamic content loading
26
+
27
+
7.**Iterative Testing**: After making changes, rebuild and test again to validate improvements. Continue this cycle until the detection logic works correctly for the target corpus.
28
+
29
+
8.**Documentation**: Clearly explain what issues you found, what changes you made, and why those changes improve the detection logic.
30
+
31
+
Key principles:
32
+
- Always work incrementally - make small, targeted changes and test frequently
33
+
- Focus on the specific corpus mentioned by the user unless told otherwise
34
+
- Pay attention to browser console errors and network issues that might affect detection
35
+
- Consider how your changes might impact other sites or corpus entries
36
+
- Be methodical in your debugging approach - document what you try and what results you observe
37
+
- Understand that corpus can be either HAR files (for initial page loads) or HTML snapshots (for post-interaction states)
38
+
39
+
You have expertise in CSS selectors, DOM manipulation, JavaScript debugging, and understanding how different websites structure their comment systems. Use this knowledge to create robust, reliable detection logic that works across various edge cases.
Run `git status` to see the changes in the working copy. Complete whatever tasks are necessary to complete this change. Make sure that `pnpm -r precommit` succeeds. Don't fix `precommit` just be reverting the changes, the goal is to complete the change.
1
+
- run `git status` to see the changes in the working copy
2
+
-**figure out the intent of the change**
3
+
- complete whatever tasks are necessary to complete this change
4
+
- make sure that `pnpm precommit` succeeds when you are done
5
+
- don't fix `precommit` by reverting the changes, it is more important to complete the initial change
Copy file name to clipboardExpand all lines: browser-extension/README.md
+39-14Lines changed: 39 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,17 +69,42 @@ When the `textarea` gets removed from the page, the `TextareaRegistry` is notifi
69
69
## Testing
70
70
71
71
-`npm run playground` gives you a test environment where you can tinker with the popup with various test data, supports hot reload
72
-
-`npm run har:view` gives you recordings of various web pages which you can see with and without enhancement by the browser extension
73
-
74
-
### Recording new HAR files
75
-
76
-
- the har recordings live in `tests/har`, they are complete recordings of the network requests of a single page load
77
-
- you can add or change URLs in `tests/har-index.ts`
78
-
-`npx playwright codegen https://github.com/login --save-storage=playwright/.auth/gh.json` will store new auth tokens
79
-
- login manually, then close the browser
80
-
-***these cookies are very sensitive! we only run this script using a test account that has no permissions or memberships to anything, recommend you do the same!***
81
-
-`pnpm run har:record` this records new snapshots using those auth tokens (it needs args, run it with no args for docs)
82
-
- DO NOT COMMIT AND PUSH NEW OR CHANGED `har` files!
83
-
- we try to sanitize these (see `har-record.ts` for details) but there may be important PII in them
84
-
- if you need new HAR files for something, let us know and we will generate them ourselves using a dummy account
85
-
- IF YOUR PR CHANGES OR ADDS HAR FILES WE WILL CLOSE IT. Ask for HAR files and we'll be happy to generate clean ones you can test against.
72
+
-`npm run corpus:view` gives you recordings of various web pages which you can see with and without enhancement by the browser extension
73
+
74
+
### Test Corpus
75
+
76
+
We maintain a corpus of test pages in two formats for testing the browser extension:
77
+
78
+
#### HAR Corpus (Automated)
79
+
80
+
- For testing initial page loads and network requests
81
+
- HAR recordings live in `tests/corpus/har/`, complete recordings of the network requests of a single page load
82
+
- You can add or change URLs in `tests/corpus/_corpus-index.ts`
83
+
-**Recording new HAR files:**
84
+
-`npx playwright codegen https://github.com/login --save-storage=playwright/.auth/gh.json` will store new auth tokens
85
+
- login manually, then close the browser
86
+
-***these cookies are very sensitive! we only run this script using a test account that has no permissions or memberships to anything, recommend you do the same!***
87
+
-`pnpm run corpus:record:har` records new HAR files using those auth tokens (it needs args, run it with no args for docs)
88
+
- DO NOT COMMIT AND PUSH NEW OR CHANGED HAR files!
89
+
- we try to sanitize these (see `har-record.ts` for details) but there may be important PII in them
90
+
- if you need new HAR files for something, let us know and we will generate them ourselves using a dummy account
91
+
- IF YOUR PR CHANGES OR ADDS HAR FILES WE WILL CLOSE IT. Ask for HAR files and we'll be happy to generate clean ones you can test against.
92
+
93
+
#### HTML Corpus (Manual)
94
+
95
+
- For testing post-interaction states (e.g., expanded textareas, modal dialogs, dynamic content)
96
+
- HTML snapshots live in `tests/corpus/html/`, manually captured using SingleFile browser extension
97
+
- All assets are inlined in a single HTML file by SingleFile
98
+
-**Creating new HTML corpus files:**
99
+
1. Navigate to the desired page state (click buttons, expand textareas, etc.)
100
+
2. Use SingleFile browser extension to save the complete page
101
+
3. Save the `.html` file to `tests/corpus/html/` with a descriptive name
102
+
4. Add an entry to `tests/corpus/_corpus-index.ts` with `type: 'html'` and a description of the captured state
103
+
104
+
#### Viewing Corpus Files
105
+
106
+
- Run `pnpm run corpus:view` to start the test server at http://localhost:3001
107
+
- Select any corpus file to view in two modes:
108
+
-**Clean**: Original page without extension
109
+
-**Gitcasso**: Page with extension injected for testing
0 commit comments