agent tool_use workflow risk: high
GitHub Starred Projects Fetcher via Agent Browser
The prompt provides step-by-step instructions to use the Agent Browser tool to launch a browser with a specific GitHub profile, confirm login, navigate to the user's starred reposi…
- Policy sensitive
- Human review
- External action: high
PROMPT
# Using Agent Browser to Fetch GitHub Starred Projects
## Objective
Use the Agent Browser skill to log into GitHub and retrieve the starred projects of the currently logged-in user, sorted by the number of stars.
## Execution Steps (Follow in Order)
1. **Launch Browser and Open GitHub Homepage**
```bash
agent-browser --headed --profile "%HOMEPATH%\.agent-browser\chrome-win64\chrome-profiles\github" open https://github.com && agent-browser wait --load networkidle
```
2. **Get Current Logged-in User Information**
```bash
agent-browser snapshot -i
# Find the user avatar or username link in the top-right corner to confirm login status
# Extract the username of the currently logged-in user from the page
```
3. **Navigate to Current User's Stars Tab**
```bash
# Construct URL: https://github.com/{username}?tab=stars
agent-browser open https://github.com/{username}?tab=stars && agent-browser wait --load networkidle
```
4. **Sort by Stars Count (Most Stars First)**
```bash
agent-browser snapshot -i # First get the latest snapshot to find the sort button
agent-browser click @e_sort_button # Click the sort button
agent-browser wait --load networkidle
# Select "Most stars" from the dropdown options
```
5. **Retrieve and Record Project Information**
```bash
agent-browser snapshot -i
# Extract project name, description, stars, and forks information
```
## Critical Notes
### 1. Daemon Process Issues
- If you see "daemon already running", the browser is already running
- **Important:** When the daemon is already running, `--headed` and `--profile` parameters are ignored, and the browser continues in its current running mode
- You can proceed with subsequent commands without reopening
- To restart in headed mode, you must first execute: `agent-browser close`, then use the `--headed` parameter to reopen
### 2. Dynamic Nature of References
- Element references (@e1, @e2, etc.) change after each page modification
- You must execute `snapshot -i` before each interaction to get the latest references
- Never assume references are fixed
### 3. Command Execution Pattern
- Use `&&` to chain multiple commands, avoiding repeated process launches
- Wait for page load after each command: `wait --load networkidle`
### 4. Login Status
- Use the `--profile` parameter to specify a profile directory, maintaining login state
- If login expires, manually log in once to save the state
### 5. Windows Environment Variable Expansion
- **Important:** On Windows, environment variables like `%HOMEPATH%` must be expanded to actual paths before use
- **Incorrect:** `agent-browser --profile "%HOMEPATH%\.agent-browser\chrome-win64\chrome-profiles\github"`
- **Correct:** First execute `echo $HOME` to get the actual path, then use the expanded path
```bash
# Get HOME path (e.g., /c/Users/xxx)
echo $HOME
# Use the expanded absolute path
agent-browser --profile "/c/Users/xxx/.agent-browser/chrome-win64/chrome-profiles/github" --headed open https://github.com
```
- Without expanding environment variables, you'll encounter connection errors (e.g., `os error 10060`)
### 6. Sorting Configuration
- Click the "Sort by: Recently starred" button (typically reference e44)
- Select the "Most stars" option
- Retrieve page content again
## Troubleshooting Common Issues
| Issue | Solution |
|-------|----------|
| daemon already running | Execute subsequent commands directly, or close then reopen |
| Invalid element reference | Execute snapshot -i to get latest references |
| Page not fully loaded | Add wait --load networkidle |
| Need to re-login | Use --headed mode to manually login once and save state |
| Sorting not applied | Confirm you clicked the correct sorting option |
## Result Output Format
- Project name and link
- Stars count (sorted in descending order)
- Forks count
- Project description (if available)
INPUTS
- username REQUIRED
-
Currently logged-in GitHub username
e.g. exampleuser
- profile_path REQUIRED
-
Absolute path to Chrome profile directory
e.g. /c/Users/xxx/.agent-browser/chrome-win64/chrome-profiles/github
REQUIRED CONTEXT
- agent-browser tool
- logged-in GitHub profile
OPTIONAL CONTEXT
- headed mode
- windows path expansion
TOOLS REQUIRED
- agent-browser
ROLES & RULES
- Follow Execution Steps in Order.
- Execute snapshot -i before each interaction.
- Never assume references are fixed.
- Use && to chain multiple commands.
- Wait for page load after each command: wait --load networkidle.
- Expand environment variables like %HOMEPATH% to actual paths before use.
- Use --profile parameter to maintain login state.
EXPECTED OUTPUT
- Format
- bullet_list
- Schema
- bullet_list · Project name and link, Stars count (sorted in descending order), Forks count, Project description (if available)
- Constraints
-
- sorted by stars descending
- include project name and link
- stars count
- forks count
- description if available
SUCCESS CRITERIA
- Log into GitHub using specified profile.
- Navigate to user's stars tab.
- Sort starred projects by most stars first.
- Extract and record project name, description, stars, and forks.
FAILURE MODES
- Daemon already running ignoring --headed and --profile.
- Invalid element references without snapshot -i.
- Page not fully loaded without wait --load networkidle.
- Connection errors from unexpanded environment variables.
- Sorting not applied due to incorrect button click.
- Login expired requiring manual re-login.
CAVEATS
- Dependencies
-
- Agent Browser tool (agent-browser command).
- Pre-configured GitHub profile directory.
- Logged-in GitHub session in the profile.
- Windows or compatible environment for path expansion.
- Missing context
-
- Exact parsing instructions for snapshot to extract username.
- Standard element selector for sort button.
- Structured JSON schema for result output format.
- Ambiguities
-
- 'Extract the username of the currently logged-in user from the page' does not specify the exact method or selector.
- '@e_sort_button' assumes a specific element reference after snapshot, which may vary.
- Mixes Windows %HOMEPATH% and bash 'echo $HOME', potentially confusing shell environments.
QUALITY
- OVERALL
- 0.85
- CLARITY
- 0.85
- SPECIFICITY
- 0.90
- REUSABILITY
- 0.70
- COMPLETENESS
- 0.85
IMPROVEMENT SUGGESTIONS
- Add precise DOM selector or script snippet for extracting username from snapshot.
- Replace '@e_sort_button' with a more robust CSS selector or describe finding it.
- Provide a complete chained bash script example with environment variable expansion.
- Define output as JSON array with fields: name, url, stars, forks, description.
USAGE
Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.
MORE FOR AGENT
- Xcode MCP Usage Guidelines for Agentsagenttool_use
- Xcode MCP Usage Guidelinesagenttool_use
- Xquik X/Twitter API Integration Skillagenttool_use
- Conventional Git Commit Creatoragenttool_use
- GitHub Trending Dashboard Generatoragenttool_use
- Trello Boards Lists Cards Integratoragenttool_use
- Git Commit Push PR Automatoragenttool_use
- In-Depth Spec Interview Refineragenttool_use
- Test AI Agent Skill Describeragenttool_use
- Comprehensive Codebase Bug Analysis and Fixeragentanalysis