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
Copy file name to clipboardExpand all lines: AGENTS.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -213,6 +213,26 @@ Use Red, Green, Refactor approach:
213
213
3. Check output in `_site/` directory
214
214
4. Check coverage: `bundle exec rake coverage`
215
215
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
+
216
236
## Notes for AI Agents
217
237
218
238
1.**Always run tests** after making changes: `bundle exec rake`
@@ -221,3 +241,35 @@ Use Red, Green, Refactor approach:
221
241
4.**Use `rake rerdoc`** to regenerate documentation (not just `rdoc`)
222
242
5.**Verify generated files** with `rake verify_generated`
223
243
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.
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