Evil Martians Documentation

website·Indexed 39 days ago

https://evilmartians.com

Resources and guides from Evil Martians, focusing on product development consulting for devtools startups and the Ruby on Rails Startup Stack. Content covers layered architecture for Rails applications, agent experience (AX), AI harnesses, and specific technical implementations involving Fullstack TypeScript, local-first principles, and tools like imgproxy and llms-visibility.

Tokens
50K
Snippets
184
Records
376
Agent score
74%

What's inside Evil Martians

  1. Overview of Ruby concurrency and performance primitives

    Modern Ruby concurrency is handled through several mechanisms:

    • Puma: Runs the application using threads.
    • Sidekiq: Processes background jobs using threads.
    • Ractors: Provide true parallelism.
    • M:N Thread Support: Enhances overall concurrency capabilities.

    Performance is significantly improved in Ruby 3 (3x faster than Ruby 2), with YJIT providing an additional ~15% boost. ZJIT (Shopify's next-generation JIT compiler) is expected in Ruby 3.5 for further gains.

  2. Overview of nanotags for Web Components

    nanotags is a thin wrapper around the Custom Elements API designed to remove the boilerplate associated with writing raw Web Components. Unlike Lit, which uses template-based rendering, nanotags focuses on wiring reactivity and behavior onto static HTML (making it particularly suitable for Astro sites). It provides a declarative API for props and refs, automatic cleanup of event listeners and effects to prevent memory leaks, and deep TypeScript integration.
  3. Use imgproxy for secure image processing

    imgproxy is a fast and secure image processing tool designed to replace hand-rolled image processing pipelines. A Pro version is available which adds priority support, ML features, watermarking, video support, and advanced image adjustments.
  4. Use AI Harnesses to enforce coding standards

    An AI harness encodes architecture, conventions, and constraints into a project so that AI coding agents (like Cursor, Claude Code, or Codex) produce code that matches team standards rather than generic training data or legacy patterns. Components of an AI harness include:

    • Project-level Instructions: Use CLAUDE.md and AGENTS.md to shape AI interactions.
    • Architecture-aware Skills: Define rules for specific patterns (e.g., service objects, query objects).
    • Tuned SAST Rules: Configure Static Analysis Security Testing to catch common LLM mistakes like SQL injection via string interpolation or SSRF.
    • Isolated Execution: Use Dev Containers for sandboxed building and testing.
    • CI Guardrails: Use tools like TestProf to prevent agents from bloating test suites and increasing CI time.
  5. Engage Evil Martians for Go performance optimization

    Evil Martians provides senior engineer engagements to optimize high-throughput paths in existing applications. They specialize in a 'hybrid' architecture where the main framework (e.g., Rails) handles auth, billing, and CRUD, while heavy workloads are delegated to Go, C, or Rust.

    Engagement Terms:

    • Initial Sprint: 2-week engagement for $14,000 to ship a real fix rather than just a report.
    • Extension: $7,000 per additional week.
    • Requirements from Client: Access to the repository, production metrics, and time with the engineers who own the service.
  6. Scale real-time features with AnyCable

    AnyCable is a dedicated real-time server that runs alongside a main application (or in the cloud) to handle real-time load, ensure message deliverability, and maintain connection reliability. It is used for building chats, collaboration tools, IoT data features, and gen-AI streaming.
  7. Optimize Application Performance and Scalability

    Evil Martians offers performance and scalability services focused on measuring and fixing bottlenecks without full rewrites. Key capabilities include:

    • Database Architecture: Designing scalable PostgreSQL schemas, implementing partitioning strategies for tables with tens of millions of rows, and executing zero-downtime migrations (e.g., PostgreSQL to PlanetScale).
    • Background Job Resilience: Implementing fair multi-tenant prioritization for Sidekiq and adding circuit breakers to prevent third-party API failures from causing full outages.
    • Multi-language Integration: Strategic use of Go, C, or Rust for high-throughput data pipelines and agent runtimes while maintaining Rails for CRUD and billing.
    • Profiling: Using flamegraphs, allocation tracking, and query analysis to identify performance bottlenecks.
  8. Implement authorization in Rails with Action Policy

    Action Policy is an authorization framework specifically designed for Ruby on Rails applications.
    # GitHub Repository
    https://github.com/palkan/action_policy
  9. Use the Layered Rails review command

    The layered-rails-skills companion gem provides a /layered-rails-review command. This command performs a standalone code review from a layered architecture perspective, identifying business logic leaks (e.g., domain rules inside controllers) and suggesting architectural fixes.
    # Run a layered architecture review on a specific file using Claude Code
    claude -p "/layered-rails-review app/controllers/orders_controller.rb"
  10. Manage Git hooks with Lefthook

    Lefthook is a Git hooks manager compatible with Node.js, Ruby, and other project types, allowing for the automation of scripts during the Git workflow.
    # GitHub Repository
    https://github.com/evilmartians/lefthook
  11. Use AgentPrism to visualize AI agent traces

    AgentPrism is an open-source React component library designed to turn AI agent traces into clear, visual diagrams, facilitating the debugging process for AI agents.
    # GitHub Repository
    https://github.com/evilmartians/agent-prism