用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Yuvasee/samocode --skill testing命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Execute implementation tasks with different approaches (single, dual-agent, plan-based).
Code quality analysis through cleanup analysis, multi-perspective reviews, and explicit finding decisions.
Interactive task definition with Q&A and documentation.
正在显示 SKILL.md
基于 SOC 职业分类
| name | testing |
| description | Test the specific feature/fix implemented in the current session using browser or API tools. |
Tests the specific feature or bug fix implemented in the current session. NOT full E2E testing - focused on the session's work.
Read session context:
_overview.md to understand what was implementedDetermine test strategy:
Select browser testing tool (if frontend testing needed):
Default: playwright-cli — use the playwright-cli skill. It handles auth, screenshots, clicks, form fills, route mocking, and extraction via a single CLI. First choice for all E2E work in this environment.
Backup: Puppeteer via bash — use only if playwright-cli is unavailable (missing install, broken Chromium, or the scenario specifically needs Puppeteer APIs).
| Tool | Role | When to use |
|---|---|---|
| playwright-cli | Primary | All E2E: auth flows, clicks, screenshots, network mocking, extraction |
Puppeteer (npx puppeteer) | Backup | Only if playwright-cli is unavailable or unsuitable |
| chrome-devtools MCP | Niche | Live console/network inspection when driving a human-operated browser |
Recommendation: Start with playwright-cli. Fall back to Puppeteer only with a stated reason.
If adding MCP (e.g., chrome-devtools): After modifying .mcp.json, signal continue to restart the agent process (MCP doesn't hot-reload).
Start the application from THIS worktree:
.samocode file or README for startup instructions.Execute feature tests:
Browser E2E is MANDATORY when implementation touched frontend files (any *.tsx/*.ts/*.jsx/*.js/*.css in the project's frontend directories). Deferring to "human verification" or to a "manual" phase in the plan is NOT allowed — regardless of what the plan labels it.
Required per FE-touching session:
[SESSION_PATH]/_screenshots/[NN]-[view-slug].png. At minimum: default state, post-interaction state, one edge case.Mock data: if the feature needs data density (lists, charts, timelines, pagination), seed it via the project's existing scripts or fixtures (check the project README, seed/fixture directories, or database*/scripts/). Empty states alone are not sufficient coverage.
API testing:
# Example: Test endpoint
curl -X POST http://localhost:8000/api/endpoint \
-H "Content-Type: application/json" \
-d '{"test": "data"}'
Smoke test (side effect):
Document results:
Create [SESSION_PATH]/[TIMESTAMP_FILE]-test-[feature-slug].md:
# Test: [feature name]
Date: [TIMESTAMP_LOG]
## What Was Tested
[Brief description of implemented feature]
## Test Environment
- Working Dir: [path]
- App Status: [running/failed to start]
- Testing Tools: [playwright-cli/puppeteer/chrome-devtools/curl]
## Test Steps
1. [Step and result]
2. [Step and result]
...
## Results
- Feature Test: [PASS/FAIL]
- Smoke Test: [PASS/FAIL]
## Issues Found
[None or list of issues]
Update session:
_overview.md:
- [TIMESTAMP_ITERATION] Feature tested: [result] -> [filename].md- [filename].md - Test reportcd [SESSION_DIR] && git add . && git commit -m "Test: [feature]"Signal result:
continue, recommend quality phaseblocked with failure details (don't auto-fix)continue if mandatory browser E2E was skipped. If the app could not be brought up after two retries, or if both playwright-cli and Puppeteer are unavailable, signal blocked with needs: "human_decision" — never defer silently.Invoke the playwright-cli skill. It handles browser automation via a single CLI — navigate, click, fill, screenshot, extract, and route-mock without writing a driver script. On hosts where the bundled Chromium is missing or unsuitable, configure .playwright/cli.config.json with an executablePath pointing at a system Chromium and any required launch flags (e.g. --no-sandbox).
Use only when playwright-cli is unavailable or the scenario needs Puppeteer-specific APIs (e.g. CDP access patterns that playwright-cli doesn't expose). State the reason for the fallback in the test report.
# Quick test script
npx puppeteer <<'EOF'
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await page.goto('http://localhost:3000');
// ... test steps
await browser.close();
})();
EOF
Useful when you need to inspect a live, human-operated session (console, network tab) rather than drive the browser yourself. Add to .mcp.json:
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["chrome-devtools-mcp@latest", "--headless=true"]
}
}
}
Then signal continue to restart with new MCP.
_overview.md -> Check project .samocode file for MAIN_REPO, or ask user