From ef00b8ef47c3081e50c8293cb0a70ebc11bb16bf Mon Sep 17 00:00:00 2001 From: "Thomas G. Lopes" Date: Wed, 25 Feb 2026 15:36:29 +0000 Subject: [PATCH] some stuff --- nvim/files/lua/plugins/context.lua | 1 + pi/files/agent/settings.json | 4 +- pi/files/agent/skills/github-prs/SKILL.md | 9 +++ .../skills/pi-skills/browser-tools/SKILL.md | 63 ++++++++++--------- 4 files changed, 46 insertions(+), 31 deletions(-) diff --git a/nvim/files/lua/plugins/context.lua b/nvim/files/lua/plugins/context.lua index 856b3b5..c67dfdd 100644 --- a/nvim/files/lua/plugins/context.lua +++ b/nvim/files/lua/plugins/context.lua @@ -1,5 +1,6 @@ return { "nvim-treesitter/nvim-treesitter-context", + enabled = false, config = function() local c = _G.matugen_palette or { diff --git a/pi/files/agent/settings.json b/pi/files/agent/settings.json index a55eb45..e8f77e1 100644 --- a/pi/files/agent/settings.json +++ b/pi/files/agent/settings.json @@ -1,7 +1,7 @@ { "lastChangelogVersion": "0.54.2", - "defaultProvider": "openrouter", - "defaultModel": "z-ai/glm-5", + "defaultProvider": "anthropic", + "defaultModel": "claude-opus-4-5", "defaultThinkingLevel": "medium", "theme": "matugen", "packages": [ diff --git a/pi/files/agent/skills/github-prs/SKILL.md b/pi/files/agent/skills/github-prs/SKILL.md index c7c6579..5f331ed 100644 --- a/pi/files/agent/skills/github-prs/SKILL.md +++ b/pi/files/agent/skills/github-prs/SKILL.md @@ -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. - Use `git branch -r | rg ` to confirm the remote branch name. - 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. diff --git a/pi/files/agent/skills/pi-skills/browser-tools/SKILL.md b/pi/files/agent/skills/pi-skills/browser-tools/SKILL.md index e50145e..f05b1da 100644 --- a/pi/files/agent/skills/pi-skills/browser-tools/SKILL.md +++ b/pi/files/agent/skills/pi-skills/browser-tools/SKILL.md @@ -16,6 +16,8 @@ cd {baseDir}/browser-tools npm install ``` +where baseDir is usually ~/.pi/agent/skills/pi-skills/browser-tools/ + ## Start Chrome ```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. Common use cases: + - 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 - 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 // Get page structure -document.body.innerHTML.slice(0, 5000) +document.body.innerHTML.slice(0, 5000); // Find interactive elements -Array.from(document.querySelectorAll('button, input, [role="button"]')).map(e => ({ - id: e.id, - text: e.textContent.trim(), - class: e.className -})) +Array.from(document.querySelectorAll('button, input, [role="button"]')).map( + (e) => ({ + id: e.id, + text: e.textContent.trim(), + class: e.className, + }), +); ``` ### 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: ```javascript -(function() { +(function () { // Multiple operations - const data = document.querySelector('#target').textContent; - const buttons = document.querySelectorAll('button'); - + const data = document.querySelector("#target").textContent; + const buttons = document.querySelectorAll("button"); + // Interactions buttons[0].click(); - + // Return results return JSON.stringify({ data, buttonCount: buttons.length }); -})() +})(); ``` ### 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: ```javascript -(function() { +(function () { const actions = ["btn1", "btn2", "btn3"]; - actions.forEach(id => document.getElementById(id).click()); + actions.forEach((id) => document.getElementById(id).click()); return "Done"; -})() +})(); ``` ### Typing/Input Sequences ```javascript -(function() { +(function () { const text = "HELLO"; for (const char of text) { document.getElementById("key-" + char).click(); } document.getElementById("submit").click(); return "Submitted: " + text; -})() +})(); ``` ### Reading App/Game State @@ -156,17 +161,17 @@ Wrap everything in an IIFE to run multi-statement code: Extract structured state in one call: ```javascript -(function() { +(function () { const state = { - score: document.querySelector('.score')?.textContent, - status: document.querySelector('.status')?.className, - items: Array.from(document.querySelectorAll('.item')).map(el => ({ + score: document.querySelector(".score")?.textContent, + status: document.querySelector(".status")?.className, + items: Array.from(document.querySelectorAll(".item")).map((el) => ({ text: el.textContent, - active: el.classList.contains('active') - })) + active: el.classList.contains("active"), + })), }; return JSON.stringify(state, null, 2); -})() +})(); ``` ### Waiting for Updates @@ -182,15 +187,15 @@ sleep 0.5 && {baseDir}/browser-eval.js '...' Always start by understanding the page structure: ```javascript -(function() { +(function () { return { title: document.title, forms: document.forms.length, - buttons: document.querySelectorAll('button').length, - inputs: document.querySelectorAll('input').length, - mainContent: document.body.innerHTML.slice(0, 3000) + buttons: document.querySelectorAll("button").length, + inputs: document.querySelectorAll("input").length, + mainContent: document.body.innerHTML.slice(0, 3000), }; -})() +})(); ``` Then target specific elements based on what you find.