Skip to content

About

Sandbox-backed blind destructive chaos lab skill for AI coding agents — snapshot local state first, then unleash 5 black-box edge tactics with tri-channel catch.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

MonkeySpec — Mischievous blind saboteur stress-testing an interface

MonkeySpec

Sandbox-Backed Blind Destructive Chaos Lab for AI Coding Agents
Snapshot first. Blind sabotage second. Tri-channel catch & zero-pollution restore.

Stars Intensity modes: poke, havoc, rampage Surfaces: Web, Mobile H5, Desktop MIT License

English · 简体中文 · Install Guide


Meet Test Subject #02. Backward slate cap. Burnt-terracotta hoodie. Zero patience for loading spinners. While UserSpec's Subject #01 politely wonders what your landing screen means, Subject #02 clicks "Create" five times in 180 milliseconds, pastes a 220-character unbroken string, deletes the record, and immediately slams Browser Back just to watch an unguarded detail component explode into a white screen.

MonkeySpec unleashes him inside a snapshot-protected sandbox—so he wrecks your edge cases before real users corrupt your production database.


Why blind sabotage + pre-test snapshots matter

When a coding agent writes a feature and "tests edge cases" in the same context window, two failure modes happen:

  1. White-Box Pull-Punching: Having just read if (isLoading) return or maxLength={60}, the agent subconsciously avoids the exact buttons, race windows, or secondary modals where guards were forgotten.
  2. Dev-Environment Pollution: Destructive testing sprays duplicate rows, whitespace-only ghost records, layout-breaking strings, and fake .png uploads straight into your local database.

MonkeySpec separates the Host Coordinator (who snapshots local data, stages malformed consumables, inspects backend DB state, patches approved bugs, and restores the clean snapshot) from an isolated Blind Saboteur subagent that never touches a single repository file.

Dimension Standard Code-Aware AI "Edge Check" MonkeySpec Blind Chaos Lab
Source Code Access Reads if-else guards, form schemas, and route handlers first. 0 repo files read; receives only a bare URL or desktop window PID.
Local Data Safety Leaves test garbage in SQLite, JSON files, and uploads/. Hard pre-test snapshot (sandbox_snapshot) + one-click clean restore that never overwrites code fixes.
Click & Async Stress Clicks once and waits politely for the response. Mashes primary/delete CTAs 5× within 200ms and thrashes tabs mid-request.
Input & File Payloads Tries "test 123" or a clean sample image. Feeds 220+ unbroken chars, " ", -1, ZWJ emoji, regex [, 0B files, and text disguised as .png.
Bug Verification Checks whether the UI "looks fine." Tri-channel forensics: UI layout/crash + Console/HTTP 5xx + backend DB dirty-row inspection, followed by exact-path replay.

Chaos Lab Protocol

MonkeySpec Sandbox-Backed Blind Destructive Chaos Workflow

1. Role Quarantine & "No Snapshot, No Monkey" Gate

  • Host Coordinator: Starts the dev server or desktop window, runs sandbox_snapshot to back up local SQLite/LibSQL DBs, JSON/YAML stores, and uploads/ folders (or localhost pg_dump/mysqldump), and hard-stops (SNAPSHOT_BLOCKED) if a remote/cloud database is detected.
  • Blind Saboteur: Runs in an isolated subagent (browser for Web/H5; sandboxed self + native window resizer/capture for Desktop/Electron) with zero repository access. Halts cleanly (AUTH_REQUIRED / PAYMENT_REQUIRED) on CAPTCHAs, real OTPs, mandatory OAuth, or real payment checkouts.

2. Five Destructive Tactics Library

  1. Rapid-Fire & Concurrency Race: Triggers 5 clicks within 200ms on submit/create/delete/generate buttons; rapidly switches tabs and routes while async requests are still in flight.
  2. Poison Inputs & Layout Bombs: Injects 220+ unbroken non-space characters (exposing missing min-w-0 / break-words), multiline newline blocks, whitespace-only " " (exposing missing .trim()), numeric extremes (0, -1, 9007199254740993, 1e309), compound ZWJ emoji (👨‍👩‍👧‍👦🏳️‍🌈🧑🏽‍🚀), unescaped regex [ / \, and benign tag probes ("'\\</div><h1>PROBE).
  3. Mid-Flow Abort & Delete-Backtrack: Half-fills modals then presses Esc, clicks the backdrop, or reloads; immediately after deleting a record, triggers Browser Back to revisit its detail URL (the #1 cause of Cannot read properties of undefined white screens).
  4. Critical Viewport Squeeze & Network Faults: Squeezes across 1440×900 → 768×900 → 375×667 → 320×568 and short landscape 1280×480 (with modals open) to catch clipped/unclickable modal footers; simulates offline/failed submissions to verify draft retention and Loading-spinner unlock.
  5. Malformed & Disguised File Feeding: Stages and uploads 0 Byte empty files, plain-text files disguised as .png, truncated JSON, and 95+ char #/%20 filenames—then immediately uploads a valid 1×1 PNG to confirm the input isn't permanently wedged.

3. Tri-Channel Catch, Crime-Scene Retention & Exact-Path Replay

Every run audits three channels simultaneously:

  • Channel 1 — Visual & DOM: White-screen crashes, horizontal page overflow, overlapping controls, unclickable off-screen modal buttons, permanent spinner deadlocks.
  • Channel 2 — Console & Network: Uncaught TypeError / SyntaxError, unhandled promise rejections, duplicate POST bursts, HTTP 500 responses.
  • Channel 3 — Storage & Database (Coordinator Forensics): Duplicate rows from rapid clicks, " " ghost rows, negative balances, orphaned foreign keys, or 0 Byte files saved on disk.

During reporting, MonkeySpec preserves the dirty crime scene so you can inspect live UI or database rows yourself. Once you select which P0 / P1 / P2 items to fix, the Coordinator patches the code, the Saboteur re-smashes along the exact reproduction paths, and sandbox_snapshot restore wipes all test pollution while keeping every code fix intact.


Intensity Modes & Chaos Receipt

MonkeySpec Chaos Intensity Modes: poke (lightweight sting, report + restore), havoc (default 5-tactic wrecking ball with crime-scene retention, replay & clean restore), and rampage (exhaustive carpet bombing across every secondary modal, 320px/short-viewport squeeze & offline stress).

Every MonkeySpec report concludes with a standardized Chaos Receipt proving blind isolation, sandbox state, and tri-channel counts:

---
**MonkeySpec Chaos Receipt** | Mode: `havoc` | Sandbox: `DIRTY SCENE KEPT (snap_20261128_110500)`
**Isolation**: Blind Saboteur (0 repo files read) · **Smashed**: `/tasks`, `/tasks/:id`, `/settings` (Tactics 1–5) · **Tri-Channel Catch**: `UI: 2 | Console/Net: 3 | Storage/DB: 2`

Supported Surfaces

  • Web Desktop: Built-in browser subagent with <200ms event-burst dispatching, host-verified navigation, and screenshot evidence.
  • Mobile H5 / Responsive Web: Multi-breakpoint viewport squeezing (768px, 375px, 320px, and 1280×480 modal-clip checks).
  • Native Desktop / Electron / Tauri: Sandboxed blind subagent paired with zero-dependency window resize & DPI-aware DWM capture scripts (capture_window.ps1 on Windows; capture_window.sh on macOS/Linux).

Installation

Antigravity

Clone the repository and reference skills in your project's .agents/skills.json (or globally in ~/.gemini/config/skills.json):

{
  "entries": [
    { "path": "/path/to/MonkeySpec/skills" }
  ]
}

Claude Code

/plugin marketplace add marksimZ/MonkeySpec
/plugin install monkeyspec@monkeyspec

Codex CLI & IDE Extension

mkdir -p ~/.agents/skills && git clone https://github.com/marksimZ/MonkeySpec.git /tmp/MonkeySpec && cp -R /tmp/MonkeySpec/skills/blind-monkey-chaos-test ~/.agents/skills/blind-monkey-chaos-test

Cursor, Windsurf, Cline, Copilot & Other Agents

Load skills/blind-monkey-chaos-test/SKILL.md directly, or copy adapters/AGENTS.md into your target project. Full OS-specific instructions are available in INSTALL.md.


Usage Examples

Run MonkeySpec (havoc mode) on http://localhost:5173 — back up our local database first, unleash the blind saboteur across all 5 tactics, and show me the P0/P1/P2 findings before editing code.
$blind-monkey-chaos-test poke
Do a quick destructive sting on http://localhost:3000 focusing on double-submit races and main form poison inputs. Report only and restore the snapshot right after.
$blind-monkey-chaos-test rampage
Carpet-bomb our Electron app ("QuantStudio") with full viewport squeezing, mid-flow aborts, malformed file imports, and offline recovery checks.

Repository Structure

MonkeySpec/
├── assets/                                             # Mascot & light/dark workflow + intensity SVGs
├── skills/
│   └── blind-monkey-chaos-test/
│       ├── SKILL.md                                    # Core protocol, sandbox hard gate, modes & prompt
│       ├── agents/openai.yaml                          # Codex / OpenAI skill display metadata
│       ├── references/
│       │   ├── tactics-01-concurrency-and-abort.md     # 200ms×5 click bursts, tab races & delete→Back
│       │   ├── tactics-02-poison-inputs-and-files.md   # 220c bombs, spaces, extremes, emoji & 0B/fake files
│       │   ├── tactics-03-viewport-and-network.md      # 320px/short-modal squeeze & offline unlock checks
│       │   ├── sandbox-and-platform-adapters.md        # Snapshot workflow, multi-surface & DB forensics
│       │   └── monkey-report-template.md               # Tri-channel P0/P1/P2 report & replay templates
│       └── scripts/
│           ├── sandbox_snapshot.ps1 / .sh              # Pre-test DB/JSON/uploads snapshot, diff & restore
│           ├── generate_poison_files.ps1 / .sh         # Zero-dep 0-byte & disguised file generator
│           └── capture_window.ps1 / .sh                # Native window resizer & DPI-accurate capture
├── adapters/AGENTS.md                                  # Compact ruleset for rules-only agents
├── .claude-plugin/                                     # Claude Code marketplace & plugin manifests
├── INSTALL.md                                          # Multi-agent installation guide
├── README.md                                           # English documentation (default)
├── README.zh-CN.md                                     # Simplified Chinese documentation
└── LICENSE                                             # MIT License

FAQ

Does sandbox_snapshot restore overwrite code fixes made after the test? No. sandbox_snapshot exclusively tracks stateful data files (.sqlite, .db, .db-wal, runtime uploads/, and non-code data files in data/ / storage/) while explicitly excluding source code extensions (.ts, .tsx, .js, .py, .go, .rs, .vue, .css, .prisma, etc.). Restoring wipes duplicate DB rows and dirty uploaded files while keeping 100% of your bugfixes intact.

What happens if my .env points to a remote Supabase, Neon, or RDS database? sandbox_snapshot parses .env files before testing and immediately halts with SNAPSHOT_BLOCKED (exit code 2) when it detects a non-local database host, preventing accidental chaos testing against shared staging or production databases.

How do UserSpec and MonkeySpec complement each other? Run UserSpec first to verify a stranger understands your UI in 5 seconds and cross-view state syncs without F5. Then run MonkeySpec to verify impatient clicks, dirty inputs, mid-flow aborts, squeezed viewports, and broken uploads cannot crash your UI or corrupt your database.


License

Released under the MIT License.

About

Sandbox-backed blind destructive chaos lab skill for AI coding agents — snapshot local state first, then unleash 5 black-box edge tactics with tri-channel catch.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages