agent-browser
Browser automation CLI for AI agents. Use when needs to interact with websites, including navigating pages, filling forms,…
Use this before writing Python code, creating Python scripts, modifying Python files, or when user asks to "write python", "create a python script", "implement in python". TRIGGER when starting any Python development task.
$ npx -y skills add archibate/dotfiles-opencode --skill writing-python --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/writing-pythonContext preview
The summary Claude sees to decide when to auto-load this skill.
Use this before writing Python code, creating Python scripts, modifying Python files, or when user asks to "write python", "create a python script", "implement in python". TRIGGER when starting any Python development task.
name: writing-python description: Use this before writing Python code, creating Python scripts, modifying Python files, or when user asks to "write python", "create a python script", "implement in python". TRIGGER when starting any Python development task.
Modern Python development using `uv` for package management, PEP 723 for single-file scripts, and best-in-class tooling.
By default, create self-contained scripts using PEP 723 format:
#!/usr/bin/env -S uv run --script
# /// script
# dependencies = [
# "typer",
# "rich",
# ]
# ///
"""
Script description and usage examples.
Usage:
uv run python3 script.py --help
uv run python3 script.py --option value
"""
import sys
# ... rest of script**Run with**: `uv run python3 script.py`
For larger projects requiring multiple files:
# Pin Python version uv python pin 3.12 # Create virtual environment uv venv --python 3.12 # Activate environment source .venv/bin/activate # Add dependencies uv add package-name # Run script uv run python script.py
All tooling configuration is centralized in `/tests/pyproject.toml`.
**Run from `/tests` directory:**
cd tests # Run tests uv run pytest uv run pytest -v # verbose # Type checking uv run pyright uv run pyright --stats # Linting & formatting uv run ruff check ../.opencode/skill uv run ruff check --fix ../.opencode/skill uv run ruff format ../.opencode/skill
**Tool choices:**
For detailed usage, see:
1. **Basic structure** - Create script with `--help` flag 2. **Test immediately** - Run with `uv run python3 script.py --help` 3. **Add `--dry-run`** - Show what would happen without executing 4. **Test again** - Verify dry-run output 5. **Add `--verbose`** - Detailed output for debugging 6. **Test again** - Verify verbose mode 7. **Continue incrementally** - Add features one at a time, testing each
#!/usr/bin/env uv run python3
# /// script # dependencies = [ # "typer", # Modern CLI framework # "rich", # Beautiful terminal output # "httpx", # Modern HTTP client # ] # ///
**Minimize dependencies** - Try using stdlib first.
uv add <package> # Add package to pyproject.toml uv remove <package> # Remove package uv sync # Install/sync dependencies uv lock # Create/update lock file
uv python install <version> # Install Python version uv python list # List installed versions uv python pin <version> # Set project Python version
uv run python script.py # Run with project environment uvx <tool> # Run tool in isolated environment uv tool install <package> # Install global tool
1. **Red** - Write failing test for new functionality 2. **Green** - Write minimal code to pass test 3. **Refactor** - Improve code while keeping tests green
**General approach**: Code directly as you see fit.
**Use TDD when**: Facing issues or building complex components.
1. **Stubs** - Define basic structure and interfaces 2. **Pseudocode** - Plan detailed logic within stubs 3. **Data Layer** - Implement data persistence and management 4. **Business Logic** - Implement core application rules 5. **CLI/Frontend** - Implement user interaction
See `references/pytest.md` for comprehensive testing guide.
.opencode/skill/<skill>/
├── SKILL.md
└── scripts/
├── <script>.py
└── tests/
└── test_<script>.pyfrom pathlib import Path
import subprocess
SCRIPT_PATH = Path(__file__).parent.parent / "script.py"
def run_script(*args, env=None):
"""Execute script with uv run."""
cmd = ["uv", "run", str(SCRIPT_PATH)] + list(args)
result = subprocess.run(cmd, capture_output=True, text=True, env=env)
return result.stdout, result.stderr, result.returncodeclass TestVersion:
"""Test --version flag."""
def test_version_flag(self):
"""--version should output version and exit with 0."""
stdout, stderr, code = run_script("--version")
assert code == 0
assert "version" in stdout.lower()| Code | Meaning | | ---- | -------------------------------- | | 0 | Success (version, help, dry-run) | | 1 | Runtime/API error | | 2 | Validation error | | 130 | Keyboard interrupt |
小彭老师现在改用claude code的开源替代opencode,满足了开源人士旺盛的定制需求x(其实opencode中也可以继续用claude的闭源模型,只是换成了开源的opencode客户端) 安装方法:SETUP.md
Browser automation CLI for AI agents. Use when needs to interact with websites, including navigating pages, filling forms,…
Review common AI slops of defensive programming patterns, avoid silent errors. TRIGGER when reviewing code for defensive…
Guide for writing ast-grep rules to perform structural code search and analysis. This skill should be used when users need to…
Best practices for AI-driven English-to-Chinese translation. This skill should be used when the user asks to "translate to…
This skill should be used when the user asks to "use bilibili API", "download bilibili video", "get bilibili user info", "list…
Interact with local Chrome browser session (only on explicit user approval after being asked to inspect, debug, or interact with…