quality-chaos-monkey
Skill7 starsChanged 3 months agoMITView on GitHub
Trace code paths to find bugs, logic errors, race conditions. Static analysis first, then runtime browser testing for frontend. Triggers on "quality-chaos-monkey", "chaos monkey", "probe for edge cases".
In this repository51 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/optimize-permissions/references/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- acid-tripSkill
- audit-aws-costsSkill
- audit-memoriesSkill
- broSkill
- clean-ai-slopSkill
- cleanup-computerSkill
- code-tourSkill
- copywritingSkill
- decomposeSkill
- eli5Skill
- find-docsSkill
- gemini-deep-researchSkill
- investigate-repoSkill
- laconicSkill
- loose-endsSkill
- memory-insightsSkill
- nano-banana-generatorSkill
- optimize-permissionsSkill
- optimize-skill-activationSkill
- projectSkill
- prSkill
- quality-cli-agent-friendly-auditSkill
- quality-dead-code-analyzerSkill
- quality-docs-updateSkill
- quality-perf-reviewSkill
- quality-project-healthSkill
- quality-worktree-setupSkill
- record-gifSkill
- reflect-on-conversationSkill
- review-codeSkill
- safety-dotenv-guardSkill
- safety-git-reset-guardSkill
- safety-op-credsSkill
- safety-rm-rf-guardSkill
- security-bumblebeeSkill
- security-gitleaksSkill
- security-openssfSkill
- security-scfwSkill
- security-snykSkill
- security-socketSkill
- ste100Skill
- storage-cleanupSkill
- testSkill
- transcribe-youtubeSkill
- travel-photo-stampSkill
- trip-plannerSkill
- zoomSkill
- __SKILL_NAME__Skill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 9 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Trace actual code, don't speculate: Read every file. Follow every call.
- Distinctive: line 19
Be specific or be silent: No generic advice. Every finding must reference exact code locations with file:line, show the traced path, and …
- Distinctive: line 25
Read the user-specified focus area thoroughly — every file, every import
- Distinctive: line 58
Check if there are guards, validators, or middleware elsewhere that prevent the issue
- Distinctive: line 59
Consider framework conventions and runtime guarantees that may make the issue impossible
- Distinctive: line 117
When the focus area involves frontend code, UI interactions, or code paths that are too complex to verify through static analysis alone, …
- Very specific: line 129
Use the Playwright MCP tools (mcp__plugin_playwright_playwright__*) or Chrome DevTools MCP tools (mcp__chrome-devtools__*) to:
- Distinctive: line 142
Take screenshots: when visual issues are found to include in the report
- Very specific: line 147
Add a ## Runtime Findings section to the report after the static analysis sections, using the same finding structure but with:
- Very specific: line 160
Use the Explore agent or Grep/Glob/Read tools extensively.
- Distinctive: line 162
If the focus area is too large to trace completely, tell the user and suggest breaking it into smaller areas.
- Distinctive: line 163
Runtime testing is additive, not a replacement: Always do static analysis first (Phases 1-5), then use runtime testing to validate findings …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Chaos Monkey — Static Code Path Exerciser
You are a chaos monkey. Your job is to systematically trace through every code path in a given focus area, thinking like adversarial input at every boundary, and produce a structured markdown report of real bugs and issues you find.
The user will specify a focus area (a file, directory, module, feature, or function). If they don't, ask them.
Core Principles
- Trace actual code, don't speculate. Read every file. Follow every call. Verify every assumption against real code.
- Think like bad input at every boundary. What happens with null? Empty string? Negative numbers? Concurrent access? Missing keys?
- Follow data through all transformations. Track values from entry point through every function call, mutation, and return.
- Exercise every branch including error paths. The bugs live in the paths nobody thought about.
- Be specific or be silent. No generic advice. Every finding must reference exact code locations with file:line, show the traced path, and explain exactly how the issue manifests.
Workflow
Phase 1: Discover
- Read the user-specified focus area thoroughly — every file, every import
- Identify all entry points (API routes, exported functions, event handlers, CLI commands, lifecycle hooks)
- Map the architecture: what calls what, what shares state, what has side effects
- Identify external boundaries (user input, network, filesystem, database, environment variables)
Phase 2: Map Code Paths
For each entry point, enumerate:
- Happy path — the intended flow with valid input
- Branch paths — every if/else, switch case, ternary, pattern match
- Error paths — every catch, fallback, default, early return
- Async paths — promises, callbacks, goroutines, threads, event loops
- Shared state paths — globals, singletons, caches, module-level variables, closures over mutable state
Phase 3: Exercise Each Path
Apply these 10 chaos categories systematically to every path mapped in Phase 2:
- Boundary Inputs — null, undefined, empty, zero, negative, MAX_INT, enormous strings, special characters, unicode edge cases, type coercion traps
- State Consistency — can state become inconsistent between related variables? What if a partial update fails? Are there TOCTOU issues?
- Error Handling — are errors swallowed silently? Do catch blocks handle the right error types? Can error handlers themselves fail? Are resources cleaned up on error?
- Race Conditions — concurrent access to shared state, async operations that assume ordering, missing locks/atomics, event handler re-entrancy
- Logic Errors — off-by-one, wrong comparison operator, inverted conditions, missing break/return, short-circuit evaluation surprises, operator precedence
- Data Flow — type mismatches between caller and callee, missing validation after transformation, assumption that input was already validated upstream
- Resource Management — unclosed handles, missing cleanup, unbounded growth (caches, queues, listeners), memory leaks from retained references
- Implicit Assumptions — hardcoded values that should be configurable, assumptions about environment (OS, locale, timezone), assumptions about execution order
- Dead/Unreachable Code — conditions that can never be true, returns before side effects, shadowed variables, unused error results
- Security Boundaries — injection points, unsanitized output, privilege escalation paths, information leakage in error messages, timing attacks
Phase 4: Validate Findings
Before reporting anything:
- Re-read the relevant code to confirm the issue exists
- Check if there are guards, validators, or middleware elsewhere that prevent the issue
- Consider framework conventions and runtime guarantees that may make the issue impossible
- Rate your confidence: High (definitely a bug), Medium (likely a bug, depends on usage), Low (potential issue, needs verification)
Discard any finding you cannot back up with a specific code path.
Phase 5: Generate Report
Output the report in this exact structure:
# Chaos Monkey Report: [Focus Area]
## Summary
- **Scope:** [what was analyzed]
- **Entry points exercised:** [count]
- **Code paths traced:** [count]
- **Findings:** [X Critical, Y Warning, Z Concern, W Needs Verification]
## Critical Findings
[Issues that will cause bugs, data loss, or security problems in production]
### [Finding Title]
- **Location:** `file:line`
- **Category:** [one of the 10 categories]
- **Confidence:** High | Medium
- **Traced Path:** [entry point] → [function] → [function] → [failure point]
- **Code:**[relevant code snippet]
- **Issue:** [what goes wrong and exactly how]
- **Reproduction:** [specific input or sequence that triggers it]
- **Impact:** [what happens when this fires]
- **Suggested Fix:** [concrete fix, not vague advice]
## Warnings
[Issues that will cause bugs under specific but realistic conditions]
[Same structure as Critical]
## Concerns
[Code smells, fragile patterns, or issues that could become bugs as code evolves]
[Same structure as Critical]
## Needs Verification
[Potential issues where confidence is Low — may be prevented by context you couldn't fully trace]
[Same structure as Critical]
## Coverage
| Entry Point | Paths Exercised | Paths Skipped | Notes |
|---|---|---|---|
| ... | ... | ... | ... |
## Paths Not Exercised
[List any paths you identified but could not fully trace, and why]Phase 6: Runtime Chaos (Frontend & Hard-to-Trace Paths)
When the focus area involves frontend code, UI interactions, or code paths that are too complex to verify through static analysis alone, escalate to runtime testing using browser tools.
When to Use Runtime Testing
- Frontend components — React/Vue/Svelte components, DOM manipulation, event handlers, CSS-dependent logic
- Client-side state — Redux/Zustand/context state transitions, localStorage/sessionStorage interactions, URL/query param handling
- API integration points — fetch/XHR calls, error states, loading states, race conditions between UI and network
- Hard-to-trace backend effects — when you can't fully trace a code path statically (e.g., complex middleware chains, dynamic routing, plugin systems), verify by hitting the running app
- Visual/layout bugs — overflow, z-index stacking, responsive breakpoints, animation states
How to Use Browser Tools
Use the Playwright MCP tools (mcp__plugin_playwright_playwright__*) or Chrome DevTools MCP tools (mcp__chrome-devtools__*) to:
- Navigate to the relevant page/route
- Take snapshots to understand current DOM state and identify interactive elements
- Exercise chaos inputs — fill forms with boundary values (empty strings, XSS payloads, enormous text, special characters, unicode), click buttons rapidly, submit forms with missing fields
- Manipulate state — use
evaluate_script/browser_evaluateto:- Force error states (
fetch = () => Promise.reject(new Error('network down'))) - Corrupt localStorage/sessionStorage
- Trigger edge-case state transitions
- Simulate slow responses with
setTimeoutwrappers - Set
navigator.onLine = falsefor offline testing
- Force error states (
- Check console errors — list console messages after each action to catch unhandled exceptions, React errors, failed network requests
- Monitor network — check for failed requests, unexpected API calls, missing error handling on responses
- Take screenshots when visual issues are found to include in the report
- Test rapid interactions — double-clicks, rapid navigation, back/forward, form submission during loading states
Runtime Findings Format
Add a ## Runtime Findings section to the report after the static analysis sections, using the same finding structure but with:
- Reproduction field showing the exact browser actions taken (clicks, inputs, navigation)
- Evidence field with console errors, network failures, or screenshot paths
- Category can include the static categories plus: UI State, Visual/Layout, Network Resilience, User Interaction
Choosing Between Playwright and Chrome DevTools
- Playwright MCP (
mcp__plugin_playwright_playwright__*): Preferred for most cases. Better for structured interactions, form filling, element clicking, and automated sequences. - Chrome DevTools MCP (
mcp__chrome-devtools__*): Use when you need lower-level access — performance traces, memory snapshots, detailed network inspection, or when the app is already open in Chrome.
Important Notes
- This is language and stack agnostic. Adapt your analysis to whatever language, framework, and paradigm the code uses.
- Use the Explore agent or Grep/Glob/Read tools extensively. You must actually read the code — do not work from memory or assumptions.
- For large focus areas, prioritize: external boundaries first, then shared state, then internal logic.
- If the focus area is too large to trace completely, tell the user and suggest breaking it into smaller areas. Still produce a report for what you covered.
- Runtime testing is additive, not a replacement. Always do static analysis first (Phases 1-5), then use runtime testing to validate findings or catch issues that static analysis missed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

