Skip to content

Commit d125241

Browse files
committed
Mention browser mcp in AGENTS.md
1 parent 16c498c commit d125241

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

AGENTS.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,26 @@ Use Red, Green, Refactor approach:
213213
3. Check output in `_site/` directory
214214
4. Check coverage: `bundle exec rake coverage`
215215

216+
### Modifying Themes/Styling
217+
218+
When making changes to theme CSS or templates (e.g., Darkfish or Aliki themes):
219+
220+
1. **Generate documentation**: Run `bundle exec rake rerdoc` to create baseline
221+
2. **Start HTTP server**: Run `cd _site && python3 -m http.server 8000` (use different port if 8000 is in use)
222+
3. **Investigate with sub-agent**: Use Task tool to launch a general-purpose agent to inspect the documentation with Browser MCP
223+
- The agent will connect browser to `http://localhost:8000`, navigate pages, and take screenshots
224+
- Agent reports findings back (styling issues, layout problems, etc.)
225+
- This saves context in main conversation
226+
4. **Make changes**: Edit files in `lib/rdoc/generator/template/<theme>/` as needed
227+
5. **Regenerate**: Run `bundle exec rake rerdoc` to rebuild documentation with changes
228+
6. **Verify with sub-agent**: Use Task tool again to launch agent that uses Browser MCP to verify fixes
229+
- Agent takes screenshots and compares to original issues
230+
- Agent reports back whether issues are resolved
231+
7. **Lint templates** (if modified): Run `npx @herb-tools/linter "lib/rdoc/generator/template/**/*.rhtml"`
232+
8. **Stop server**: Kill the HTTP server process when done
233+
234+
**Tip:** Keep HTTP server running during iteration. Just regenerate with `bundle exec rake rerdoc` between changes.
235+
216236
## Notes for AI Agents
217237

218238
1. **Always run tests** after making changes: `bundle exec rake`
@@ -221,3 +241,35 @@ Use Red, Green, Refactor approach:
221241
4. **Use `rake rerdoc`** to regenerate documentation (not just `rdoc`)
222242
5. **Verify generated files** with `rake verify_generated`
223243
6. **Don't edit generated files** directly (in `lib/rdoc/markdown/` and `lib/rdoc/rd/`)
244+
245+
## Browser MCP for Testing Generated Documentation
246+
247+
Browser MCP allows AI agents to visually inspect and interact with the generated HTML documentation. This is useful for verifying CSS styling, layout issues, and overall appearance.
248+
249+
**Repository:** <https://github.com/BrowserMCP/mcp>
250+
251+
### Setup
252+
253+
If Browser MCP is not already installed, users should:
254+
255+
1. Install the BrowserMCP Chrome extension from the Chrome Web Store
256+
2. Run: `claude mcp add --scope user browsermcp npx @browsermcp/mcp@latest`
257+
3. Connect a browser tab by clicking the BrowserMCP extension icon and selecting "Connect"
258+
259+
### Testing Generated Documentation
260+
261+
To test the generated documentation with Browser MCP:
262+
263+
```bash
264+
# Generate documentation
265+
bundle exec rake rerdoc
266+
267+
# Start a simple HTTP server in the _site directory (use an available port)
268+
cd _site && python3 -m http.server 8000
269+
```
270+
271+
If port 8000 is already in use, try another port (e.g., `python3 -m http.server 9000`).
272+
273+
Then navigate to the appropriate URL (e.g., `http://localhost:8000`) in your connected browser tab and ask Claude to use browser MCP tools (e.g., "use browser MCP to navigate to <http://localhost:8000> and take a screenshot").
274+
275+
**Note:** Browser MCP requires a proper HTTP server (not `file://` URLs) for full functionality. The generated documentation must be served via HTTP/HTTPS.

0 commit comments

Comments
 (0)