pi-skills

repository·main·Indexed 24 days ago

https://github.com/badlogic/pi-skills

A collection of specialized skills for AI coding agents such as pi-coding-agent, Claude Code, Codex CLI, Amp, and Droid. These skills extend agent capabilities to include web searching via Brave Search, browser automation, and management of Google services including Calendar (gccli), Drive (gdcli), and Gmail (gmcli). Other available skills include transcription, VS Code integration, and YouTube transcript extraction.

Tokens
6.8K
Snippets
32
Records
46
Agent score
78%

What's inside pi-skills

  1. Understand the Brave Search output format

    main

    Search results are returned in a structured text format. If the --content flag is used, the markdown content of the page is appended to the result. Each result includes:

    • Title: The page title
    • Link: The URL
    • Age: Relative time (e.g., '2 days ago')
    • Snippet: The description from search results
    • Content: (Optional) The extracted markdown content
    --- Result 1 ---
    Title: Page Title
    Link: https://example.com/page
    Age: 2 days ago
    Snippet: Description from search results
    Content: (if --content flag used)
      Markdown content extracted from the page...
    
    --- Result 2 ---
    ...
  2. Efficiency Guide: DOM Inspection vs Screenshots

    main

    To improve efficiency and reliability, prefer parsing the DOM directly over taking screenshots to understand page state. Use browser-eval.js to inspect the structure and interactive elements.

    // Get page structure
    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
    }))
  3. Understand the difference between search and ls --query

    main

    When looking for files in Google Drive via gdcli, choose the command based on what you are searching for:

    1. search "<text>": Use this for full-text content search. It looks inside the actual content of the files.
    2. ls --query "<query>": Use this for metadata filtering. This is the correct command for searching by filename, file type, date, or owner.
  4. Install pi-skills for pi-coding-agent

    main

    You can install pi-skills for pi-coding-agent at either the user level (available globally across all projects) or the project level (scoped to a specific directory).

    User-level installation: Clone the repository to ~/.pi/agent/skills/pi-skills.

    Project-level installation: Clone the repository to .pi/skills/pi-skills within your project directory.

    # User-level (available in all projects)
    git clone https://github.com/badlogic/pi-skills ~/.pi/agent/skills/pi-skills
    
    # Or project-level
    git clone https://github.com/badlogic/pi-skills .pi/skills/pi-skills
  5. Use gmcli for Gmail operations

    main

    Once configured, you can perform various Gmail operations using the <email> argument (the Gmail address associated with the account). Use gmcli --help for the full command reference.

    Common Commands:

    • Search: gmcli <email> search "<query>" (uses Gmail query syntax)
    • Read Thread: gmcli <email> thread <threadId> (reads a thread and all its messages)
    • Send Email: gmcli <email> send --to <emails> --subject <s> --body <b>
    • List Labels: gmcli <email> labels list
    • List Drafts: gmcli <email> drafts list
  6. Use gdcli for common Google Drive operations

    main

    Most gdcli commands require your Google account email as the first argument.

    Common Commands:

    • List files/folders: gdcli <email> ls [folderId]
    • Full-text search: gdcli <email> search "<text>" (searches inside file contents)
    • Download a file: gdcli <email> download <fileId> [destPath]
    • Upload a file: gdcli <email> upload <localPath> [--folder <folderId>]
    • Create a folder: gdcli <email> mkdir <name>
    • Share a file: gdcli <email> share <fileId> --anyone (shares publicly)
    gdcli <email> ls [folderId]
    gdcli <email> search "<text>"
    gdcli <email> download <fileId> [destPath]
    gdcli <email> upload <localPath> [--folder <folderId>]
    gdcli <email> mkdir <name>
    gdcli <email> share <fileId> --anyone
  7. Efficiency Guide: Batching and Complex Scripts

    main

    When automating interactions, avoid making multiple separate CLI calls for individual actions. Instead, wrap multiple operations (clicks, inputs, data extractions) into a single JavaScript IIFE executed via browser-eval.js to reduce overhead and latency.

    // Batching multiple clicks
    (function() {
      const actions = ["btn1", "btn2", "btn3"];
      actions.forEach(id => document.getElementById(id).click());
      return "Done";
    })()
    
    // Complex typing sequence
    (function() {
      const text = "HELLO";
      for (const char of text) {
        document.getElementById("key-" + char).click();
      }
      document.getElementById("submit").click();
      return "Submitted: " + text;
    })()
  8. Pick DOM elements interactively

    main

    Use this tool when you need to select specific elements on a page via user interaction. It launches an interactive picker where the user can click elements (using Cmd/Ctrl+Click for multiple selections) and press Enter. The tool returns the CSS selectors for the selected elements.

    {baseDir}/browser-pick.js "Click the submit button"