some stuff

This commit is contained in:
Thomas G. Lopes
2026-02-25 15:36:29 +00:00
parent 6978c77066
commit ef00b8ef47
4 changed files with 46 additions and 31 deletions
+1
View File
@@ -1,5 +1,6 @@
return { return {
"nvim-treesitter/nvim-treesitter-context", "nvim-treesitter/nvim-treesitter-context",
enabled = false,
config = function() config = function()
local c = _G.matugen_palette local c = _G.matugen_palette
or { or {
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"lastChangelogVersion": "0.54.2", "lastChangelogVersion": "0.54.2",
"defaultProvider": "openrouter", "defaultProvider": "anthropic",
"defaultModel": "z-ai/glm-5", "defaultModel": "claude-opus-4-5",
"defaultThinkingLevel": "medium", "defaultThinkingLevel": "medium",
"theme": "matugen", "theme": "matugen",
"packages": [ "packages": [
@@ -88,3 +88,12 @@ gh repo view --web
- If `gh pr list --head` returns nothing, the PR may not exist yet, or the branch name differs. - If `gh pr list --head` returns nothing, the PR may not exist yet, or the branch name differs.
- Use `git branch -r | rg <branch-name>` to confirm the remote branch name. - Use `git branch -r | rg <branch-name>` to confirm the remote branch name.
- Ensure you're in the correct repo (`git remote -v`). - Ensure you're in the correct repo (`git remote -v`).
## CRITICAL: Never Comment as the User
**NEVER post comments, replies, or reviews on PRs on behalf of the user.** This includes:
- `gh pr comment`
- `gh pr review`
- GraphQL mutations like `addPullRequestReviewThreadReply`, `addPullRequestReviewComment`, etc.
The agent must only read PR information and make code changes. The user will post their own comments.
@@ -16,6 +16,8 @@ cd {baseDir}/browser-tools
npm install npm install
``` ```
where baseDir is usually ~/.pi/agent/skills/pi-skills/browser-tools/
## Start Chrome ## Start Chrome
```bash ```bash
@@ -60,6 +62,7 @@ Capture current viewport and return temporary file path. Use this to visually in
**IMPORTANT**: Use this tool when the user wants to select specific DOM elements on the page. This launches an interactive picker that lets the user click elements to select them. The user can select multiple elements (Cmd/Ctrl+Click) and press Enter when done. The tool returns CSS selectors for the selected elements. **IMPORTANT**: Use this tool when the user wants to select specific DOM elements on the page. This launches an interactive picker that lets the user click elements to select them. The user can select multiple elements (Cmd/Ctrl+Click) and press Enter when done. The tool returns CSS selectors for the selected elements.
Common use cases: Common use cases:
- User says "I want to click that button" → Use this tool to let them select it - User says "I want to click that button" → Use this tool to let them select it
- User says "extract data from these items" → Use this tool to let them select the elements - User says "extract data from these items" → Use this tool to let them select the elements
- When you need specific selectors but the page structure is complex or ambiguous - When you need specific selectors but the page structure is complex or ambiguous
@@ -98,14 +101,16 @@ Navigate to a URL and extract readable content as markdown. Uses Mozilla Readabi
```javascript ```javascript
// Get page structure // Get page structure
document.body.innerHTML.slice(0, 5000) document.body.innerHTML.slice(0, 5000);
// Find interactive elements // Find interactive elements
Array.from(document.querySelectorAll('button, input, [role="button"]')).map(e => ({ Array.from(document.querySelectorAll('button, input, [role="button"]')).map(
id: e.id, (e) => ({
text: e.textContent.trim(), id: e.id,
class: e.className text: e.textContent.trim(),
})) class: e.className,
}),
);
``` ```
### Complex Scripts in Single Calls ### Complex Scripts in Single Calls
@@ -113,17 +118,17 @@ Array.from(document.querySelectorAll('button, input, [role="button"]')).map(e =>
Wrap everything in an IIFE to run multi-statement code: Wrap everything in an IIFE to run multi-statement code:
```javascript ```javascript
(function() { (function () {
// Multiple operations // Multiple operations
const data = document.querySelector('#target').textContent; const data = document.querySelector("#target").textContent;
const buttons = document.querySelectorAll('button'); const buttons = document.querySelectorAll("button");
// Interactions // Interactions
buttons[0].click(); buttons[0].click();
// Return results // Return results
return JSON.stringify({ data, buttonCount: buttons.length }); return JSON.stringify({ data, buttonCount: buttons.length });
})() })();
``` ```
### Batch Interactions ### Batch Interactions
@@ -131,24 +136,24 @@ Wrap everything in an IIFE to run multi-statement code:
**Don't** make separate calls for each click. **Do** batch them: **Don't** make separate calls for each click. **Do** batch them:
```javascript ```javascript
(function() { (function () {
const actions = ["btn1", "btn2", "btn3"]; const actions = ["btn1", "btn2", "btn3"];
actions.forEach(id => document.getElementById(id).click()); actions.forEach((id) => document.getElementById(id).click());
return "Done"; return "Done";
})() })();
``` ```
### Typing/Input Sequences ### Typing/Input Sequences
```javascript ```javascript
(function() { (function () {
const text = "HELLO"; const text = "HELLO";
for (const char of text) { for (const char of text) {
document.getElementById("key-" + char).click(); document.getElementById("key-" + char).click();
} }
document.getElementById("submit").click(); document.getElementById("submit").click();
return "Submitted: " + text; return "Submitted: " + text;
})() })();
``` ```
### Reading App/Game State ### Reading App/Game State
@@ -156,17 +161,17 @@ Wrap everything in an IIFE to run multi-statement code:
Extract structured state in one call: Extract structured state in one call:
```javascript ```javascript
(function() { (function () {
const state = { const state = {
score: document.querySelector('.score')?.textContent, score: document.querySelector(".score")?.textContent,
status: document.querySelector('.status')?.className, status: document.querySelector(".status")?.className,
items: Array.from(document.querySelectorAll('.item')).map(el => ({ items: Array.from(document.querySelectorAll(".item")).map((el) => ({
text: el.textContent, text: el.textContent,
active: el.classList.contains('active') active: el.classList.contains("active"),
})) })),
}; };
return JSON.stringify(state, null, 2); return JSON.stringify(state, null, 2);
})() })();
``` ```
### Waiting for Updates ### Waiting for Updates
@@ -182,15 +187,15 @@ sleep 0.5 && {baseDir}/browser-eval.js '...'
Always start by understanding the page structure: Always start by understanding the page structure:
```javascript ```javascript
(function() { (function () {
return { return {
title: document.title, title: document.title,
forms: document.forms.length, forms: document.forms.length,
buttons: document.querySelectorAll('button').length, buttons: document.querySelectorAll("button").length,
inputs: document.querySelectorAll('input').length, inputs: document.querySelectorAll("input").length,
mainContent: document.body.innerHTML.slice(0, 3000) mainContent: document.body.innerHTML.slice(0, 3000),
}; };
})() })();
``` ```
Then target specific elements based on what you find. Then target specific elements based on what you find.