reproduce
Reproduce
Verify behavior with automation, APIs, logs, and data checks before opening browser DevTools.
Rules
- Do not ask the user to test until you attempted at least two independent verification paths and reported command outputs.
- Prefer existing test suite and repo-native scripts first.
- Prefer CLI/API/log/DB probes over browser inspection.
- Propose at least three non-DevTools alternatives before escalating to DevTools.
- If blocked by missing access, request the minimum required access with exact purpose and command.
- Open DevTools only if non-browser paths cannot observe the behavior.
- If DevTools is used, include the DevTools Justification block.
- Finalize with regression protection: add or update tests so the issue is prevented from silently returning.
- For local-environment bugs, codify seed/restart/env-sync steps in
.env-managerautomation so future runs are one command.
Workflow
1) Discover how the repo is testable
Run fast discovery commands:
rg --files | rg -i '(^|/)(README|Makefile|Justfile|package\.json|pyproject\.toml|go\.mod|docker-compose.*\.ya?ml)$'
rg -n -S 'pytest|vitest|jest|playwright|cypress|e2e|smoke|integration|health|make test|npm run test|pnpm test|uv run pytest'
Select the fastest useful signal in this order:
- Existing focused test.
- Existing health/smoke check.
- Direct API or CLI probe.
- Log and DB state verification.
- New minimal regression test.
- DevTools (last).
2) Run command-first probes
Use references/probe-ladder.md for symptom-to-command mappings.
Minimum bar for "I tested it":
- One behavior assertion (test/API response/status code/CLI output).
- One side-effect assertion (log line, DB row/state transition, emitted event, email/job artifact).
Before escalating, list and try multiple ideas from different surfaces:
- Test surface: run focused existing tests, then add a minimal failing regression test if missing.
- API surface: replay the flow with
curl/CLI and assert response contract. - Runtime surface: inspect app, worker, and proxy logs around the event window.
- Data surface: verify DB/cache/queue side effects directly.
- Infra surface: health, container state, env wiring, dependency reachability.
3) Use ecosystem checks when available
If .env-manager exists (HTMA/OpenClaw local ecosystem), run:
if [ -d ../.env-manager ]; then
ENVM="$(cd ../.env-manager && pwd)"
elif [ -d "$HOME/repos/.env-manager" ]; then
ENVM="$HOME/repos/.env-manager"
fi
REPOS_ROOT="${REPOS_ROOT:-$(cd "$ENVM/.." && pwd)}"
SANITY="$(ls ~/.codex/skills/dev-sanity/scripts/sanity_check.sh ~/.claude/skills/dev-sanity/scripts/sanity_check.sh "$REPOS_ROOT/opensource/skills/dev-sanity/scripts/sanity_check.sh" 2>/dev/null | head -1)"
bash "$SANITY" --errors-only
For Google/email workflows, prefer gog plus service logs instead of manual inbox/browser checks.
For local bug closeout, also run:
bash "$SANITY" --health-only
bash "$SANITY" --wiring-only
Reference $dev-sanity whenever the issue is local runtime/configuration behavior.
4) Fill gaps instead of punting
If no deterministic path exists, add the smallest regression test or smoke script that proves the fix.
Preferred pattern:
- Add one failing test reproducing the bug.
- Implement the fix.
- Re-run the focused test and nearest related suite.
If still blocked, propose at least three concrete next ideas, each with:
- Command(s) to run.
- Expected signal.
- Why it may isolate the bug.
Example idea set:
- Add temporary request/response logging around the suspected handler and re-run a
curlprobe. - Replay production-like payload from logs into local API to test parser/validation drift.
- Run headless E2E from CLI (Playwright/Cypress) before any interactive browser tooling.
5) Access request protocol (before DevTools)
If a better verification path exists but requires access, request it directly instead of jumping to DevTools.
Use this format:
Access Request
- Missing access: <credential/service/env/host/container>
- Why needed: <specific verification goal>
- Command once granted: `<exact command>`
- Expected evidence: <what pass/fail output will show>
- Fallback if denied: <next-best command-first path>
Ask for the minimum needed. Prefer read-only access for verification tasks.
6) DevTools gate (last resort)
Only use DevTools if all are true:
- Behavior is browser-runtime-only (layout, paint, client-only state, extension-specific issue).
- No API/log/test/CLI assertion can observe it.
- At least two non-DevTools probes were attempted first.
When used, report:
DevTools Justification
- Target behavior: <what must be observed>
- Why command-line probes are insufficient: <reason>
- Non-DevTools attempts:
1. `<command>` -> `<result>`
2. `<command>` -> `<result>`
- DevTools action: <panel + exact check>
- Evidence captured: <console/network/screenshot/log reference>
7) Regression lock-in (required final step)
When root cause is clear and test coverage is feasible, end by codifying the bug as a regression test.
Required sequence:
- Write or update a focused test that fails on the buggy behavior.
- Apply the fix.
- Re-run the focused test (must pass).
- Re-run nearest related suite to catch collateral breakage.
If no test can be added, explicitly state why and provide the closest durable alternative (for example: a deterministic smoke script with clear assertions).
8) Local automation lock-in (required for local env bugs)
If resolution required manual seeding, startup ordering, env sync, or restarts, update .env-manager so the same class of bug is faster to catch and recover.
Required sequence:
- Promote manual local commands into
.env-managerautomation (typicallyMakefiletargets and scripts it calls). - Ensure seeding and restart flows are idempotent or clearly split into explicit safe targets.
- Validate from automation entrypoint (not ad-hoc one-off commands).
- Re-run
$dev-sanitychecks to verify the loop is healthy.
Preferred path in this repo layout:
- Update
../../.env-manager/Makefile(or referenced scripts) when local seed/restart behavior should be standardized. - Start/restart using
.env-managertargets. - Run
bash "$SANITY" --errors-only,--health-only, and--wiring-only.
Do not leave critical local recovery steps as undocumented manual commands in chat output.
Response Template
After verification, reply with:
Verification Summary
- Claim: <what works or fails>
- Commands run:
1. `<command>`
2. `<command>`
- Evidence:
- Assertion: <output/status/log/test evidence>
- Side effect: <db/log/event artifact>
- Alternatives attempted: <3+ non-DevTools ideas tried or ruled out>
- Access requested (if any): <what was requested and why>
- Regression protection: <failing test added/updated, file path, and pass result; or why not feasible>
- Local automation updates: <.env-manager Makefile/script changes for seed/restart/env sync; or not applicable>
- Dev sanity closeout: <errors/health/wiring results; or not applicable>
- Decision: PASS | FAIL | PARTIAL
- Next command (if needed): `<command>`
If blocked, state exactly what prevented testing and the next concrete command needed to unblock. Do not stop at "please test this" without attempting a path first.