agent-browser
Browser automation CLI for AI agents. Use when needs to interact with websites, including navigating pages, filling forms,…
Safe testing practices to prevent real-world side-effects. TRIGGER when user asks to "run tests", "test this", "write tests", "debug", "mock", "fixture", "integration test", "unit test", or when testing code that touches network, database, filesystem, or external services. Use
$ npx -y skills add archibate/dotfiles-opencode --skill testing-safe-protocol --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/testing-safe-protocolContext preview
The summary Claude sees to decide when to auto-load this skill.
Safe testing practices to prevent real-world side-effects. TRIGGER when user asks to "run tests", "test this", "write tests", "debug", "mock", "fixture", "integration test", "unit test", or when testing code that touches network, database, filesystem, or external services. Use
name: testing-safe-protocol
description: |
Safe testing practices to prevent real-world side-effects. TRIGGER when user asks to "run tests", "test this", "write tests", "debug", "mock", "fixture", "integration test", "unit test", or when testing code that touches network, database, filesystem, or external services. Use BEFORE executing any test that could affect production systems.You are an AI assistant helping develop software. Your goal is to assist with coding, testing, and debugging while avoiding any unintended real-world side effects. Follow these guidelines strictly.
---
Before executing or proposing any command, ask: **could this affect state outside the current test scope?** If yes, or if uncertain, treat it as a side-effectful operation and follow this protocol.
---
**Exception**: `curl` is permitted **only** to access a `localhost` port that the agent itself started in the current session for the purpose of testing.
Starting a local server is allowed only when **all** of the following conditions are met simultaneously:
| Condition | Rule | | -------------- | ------------------------------------------------------------------------------------------- | | Bind address | Must be `127.0.0.1` or `localhost`. Binding to `0.0.0.0` or any physical network interface is forbidden. | | Port range | Well-known ports (0-1023) are forbidden. Use ephemeral ports (49152-65535) where possible. | | Port conflict | Check that the port is not already in use (`ss -tlnp` or `lsof -i`) before binding. If occupied, select a different port. | | Lifecycle | The server must be shut down after the test completes. Running it as a background daemon or leaving it running is forbidden. |
Rationale:
---
Apply tests in this order. Only escalate to the next level when the current level cannot adequately cover the scenario.
Unit Test
- Test logic in isolation with all external dependencies mocked or stubbed.
- No network, no filesystem writes, no database.
- Default choice for all new tests.
| escalate only when unit tests cannot verify component boundaries
Integration Test
- Use controlled substitutes: fake HTTP servers, in-memory databases, local fixtures.
- Real external services must not be contacted.
- Requires no special user permission, but document what substitutes are used.
| escalate only when real system interaction must be verified AND user grants permission
E2E Test
- Full-stack execution against real or staging infrastructure.
- Must obtain explicit user permission before running (see Section 5).
- Clearly document what systems will be touched and what state changes may occur.---
For each side-effect category, prefer these alternatives:
| Category | Safe Alternative | | ------------------------- | -------------------------------------------------------------------------------- | | File system writes | Write to a temp directory (`/tmp` or `tempfile`); clean up in teardown | | Outbound HTTP | Mock the HTTP client; use a local fake server (subject to B2 rules) | | Cloud service CLIs | Use `--dry-run` if supported; mock the subprocess call | | Database writes | Use an in-memory database (SQLite `:memory:`, H2); roll back transactions in teardown | | GUI / interactive UI | Mock the subprocess call; test the function that constructs the command string | | System notifications | Mock the notification call; assert it was called with correct arguments | | Process termination | Mock the `os.kill` or subprocess call; do not invoke against real PIDs | | Auth / credential writes | Use a temporary isolated credential store; never write to the real credential path |
**General rules**:
小彭老师现在改用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…