↓ Ir para o conteúdo principal
0

Uno-Reverse: Radical Simplification & Red-Teaming #

“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” — Antoine de Saint-Exupéry

The uno-reverse skill provides a rigorous contrarian simplification and red-teaming framework. While standard engineering processes naturally drift toward feature accretion, defensive layering, and speculative generalization, uno-reverse forces the opposite trajectory: aggressive subtraction, primitive collapsing, and minimum viable execution.


🎭 Impartial Review: Dedicated Subagent Delegation (Default) #

To guarantee the integrity and rigor of an Occam’s Razor red-team assessment, uno-reverse reviews must be conducted by a dedicated, isolated subagent rather than within the invoking agent’s active conversation context.

1. Rationale: Why In-Context Audits Fail #

When an agent that designed, brainstormed, or iteratively implemented a solution attempts to evaluate its own work inline, the review suffers from three critical failure modes:

  1. Confirmation Bias & Sunk-Cost Defense: An agent that spent multiple conversation turns proposing abstractions, schemas, microservices, or config flags naturally rationalizes their existence. A dedicated subagent has zero psychological or conversational investment in prior proposals.
  2. Context Contamination: Long-running conversation contexts contain discarded ideas, exploratory reasoning, edge-case anxieties, and premature compromises. This cognitive residue biases the evaluation toward maintaining accidental complexity. A fresh subagent receives only the target specification and the audit mandate, evaluating it with a clean slate.
  3. Preserving Impartiality & Objective Distance: Genuine red-teaming requires contrarian detachment. An isolated subagent is uninhibited by politeness or conversational continuity—it can objectively propose deleting 90% of a specification without defending earlier dialogue.

2. Default Delegation Policy & User Override #

  • DEFAULT Behaviour: When uno-reverse is activated (via slash command //uno-reverse, skill loading, or prompt directive), the parent agent MUST spawn a dedicated uno-reverse subagent using invoke_subagent and immediately yield execution.
  • Inline Override: Subagent delegation is bypassed ONLY if the user explicitly requests an inline review (e.g., “review inline”, “run uno-reverse in this session”, or “do not use subagents”). In that case, the parent agent executes the 4-step workflow directly in the current context.

3. Delegation Pattern & Subagent Invocation #

When delegating, select the subagent type:

  • research (Default): Ideal for read-only audits of design documents, PRDs, architectural RFCs, and codebases.
  • self: Use when the audit also requires writing code, refactoring files, or generating alternative implementations directly on disk.
  • Model: 'inherit': Preserve the parent session’s reasoning effort and model capabilities.

Antigravity invoke_subagent Pattern: #

json
{
  "Subagents": [
    {
      "TypeName": "research",
      "Role": "Uno-Reverse Auditor",
      "Model": "inherit",
      "Prompt": "You are an impartial, contrarian Uno-Reverse Auditor tasked with radical simplification and red-teaming.\n\n### Target of Audit:\n[FILE_PATH_OR_TARGET_DESCRIPTION]\n\n### Mandate & Mindset:\n- You have ZERO investment in prior discussions, earlier decisions, or existing abstractions.\n- Challenge every moving part, configuration flag, caching layer, and speculative interface.\n- Treat complexity as a liability: Reliability = 1 / (Moving Parts ^ 2).\n- Apply the 4 Inversion Principles (Subtraction Before Addition, Primitive Collapsing, Zero-Speculation YAGNI, Failure-Surface Inversion).\n- Respect Chesterton's Fence: understand the failure mode before eliminating essential safety.\n\n### Instructions:\n1. Execute the 4-Step Uno-Reverse Audit Workflow (Subtraction Test, Primitive Collapsing, Cache & State Probe, 10% MVP).\n2. Format your complete findings strictly as the 'Simplification Audit Scorecard':\n   - Executive Inversion Summary (Proposed Complexity, Verdict, Code Reduction %)\n   - The Cut List (Items to eliminate, rationale, what happens without it)\n   - Collapsed Primitives (Disparate mechanisms -> Single primitive)\n   - Minimalist Reference Design (10% MVP spec / code)\n   - Chesterton Boundary Assessment (Essential complexity kept vs. pruned)\n3. Report your findings back using send_message."
    }
  ]
}

Lifecycle & Non-Blocking Coordination: #

  1. Dispatch & Yield: The parent agent invokes the subagent and immediately halts tool calls to end its turn. It never polls, sleeps, or busy-waits.
  2. Report Reception: When the subagent completes the audit and sends its report, the parent agent wakes up reactively.
  3. Synthesis & Presentation: The parent agent delivers the unvarnished scorecard to the user or uses the minimalist reference design to guide subsequent implementation.

🎯 The 4 Inversion Principles #

text
  ┌─────────────────────────────────────────────────────────────┐
  │                    THE UNO-REVERSE RAZOR                    │
  ├─────────────────────────────────────────────────────────────┤
  │ 1. Subtraction Before Addition: "Can we delete our way out?" │
  │ 2. Primitive Collapsing: "Can 1 composable primitive do 5 jobs?"│
  │ 3. Zero-Speculation (YAGNI): "Are we solving an imagined problem?"│
  │ 4. Failure-Surface Inversion: "How will this complexity break?" │
  └─────────────────────────────────────────────────────────────┘
  1. Subtraction Before Addition: Before designing a new subsystem, caching layer, or protocol, ask: What existing assumption or artificial constraint can be deleted to make this entire feature unnecessary?
  2. Primitive Collapsing: Engineers frequently add flags, endpoints, and micro-abstractions for every sub-case. Identify the single underlying mathematical or conceptual primitive that subsumes all sub-cases without bespoke code.
  3. Zero-Speculation (Strict YAGNI): Reject all “future-proofing”, pluggable abstraction layers for single implementations, and configurable policies where a single sensible constant or deterministic convention works.
  4. Failure-Surface Inversion: Evaluate a system by its total attack, bug, and maintenance surface:
    text
    Reliability = 1 / (Moving Parts ^ 2)
    Every added cache, lock, daemon, state file, and flag represents a new failure mode and cognitive tax.

🚩 Speculative Language Red-Flag Filter (PRDs & Specs) #

When auditing technical proposals or PRDs, immediately flag these weasel phrases:

Speculative Phrase ❌Underlying RealityUno-Reverse Action ✅
“Future-proof design”Unused code and speculative abstractions todayDelete the abstraction; write the concrete implementation.
“Pluggable provider model”Only 1 provider existsHardcode the single provider until a 2nd concrete provider is built.
“Flexible policy engine”Author avoided making a design decisionPick the single sensible default convention.
“Event-driven microservices”Synchronous calls disguised as message queuesUse direct in-process function calls.
“Highly configurable”Shifting architectural choices to end-usersShip zero flags; make opinionated choices.
“Generic abstraction layer”Premature DRY before seeing 3 distinct patternsDuplicate the 5 lines of code; wait for Rule of Three.

🔬 Accidental Complexity Code Smells (Codebase Audits) #

When reviewing code, actively hunt down and prune these structural anti-patterns:

  1. Single-Implementation Interfaces:
    • Smell: An interface FooService with only one concrete struct fooServiceImpl.
    • Fix: Delete the interface. Export the concrete struct directly. Introduce interfaces only when consumers need mocking at architectural boundaries.
  2. Passthrough Wrapper Functions:
    • Smell: Function GetUserData(id) that does nothing except call db.FetchUser(id).
    • Fix: Eliminate the middleman. Call the underlying operation directly.
  3. State Machine Inflation:
    • Smell: A 7-state lifecycle machine (PENDING_APPROVAL, READY_FOR_QUEUE, QUEUED, …) with 15 transition validation functions.
    • Fix: Collapse to 2 boolean flags or an active/done state.
  4. Relational Over-Normalization for Small Datasets:
    • Smell: A 6-table normalized schema with foreign keys and joins for < 10,000 total records.
    • Fix: Store as a single flat SQLite table, JSON document, or in-memory map.

🤖 The Agent & AI Workflow Razor #

AI systems are especially prone to multi-agent and prompt bloat. Apply these rules:

Bloated Agent Pattern ❌Collapsed Alternative ✅Rationale
5-Agent Swarm for sequential taskSingle agent with 1 clear promptMulti-agent handoffs add latency, token cost, and lossy context degradation.
Intermediate Summarizer AgentsDirect downstream consumption“Telephone game” summarization strips critical nuance.
Micro-Tool Sprawl (10 single-action tools)1 Polymorphic Tool with clear argsDecreases tool selection entropy and LLM routing hallucinations.
Autonomous Loop without GuardrailsDeterministic script + LLM leaf nodeUse code for control flow and LLMs only for fuzzy transformation.
ℹ️ NOTE

Subagent Delegation vs. Swarm Bloat: While multi-agent swarms for linear tasks are an anti-pattern, delegating an assessment to a single, isolated subagent for red-teaming is essential. The subagent boundary provides clean context isolation, eliminating confirmation bias and conversational anchoring without adding orchestrational sprawl.


🔍 The 4-Step Uno-Reverse Audit Workflow #

When invoked on a design document, PRD, or proposed codebase change, execute this 4-step inversion protocol:

flowchart TD
    A[Incoming Proposal / Complex Spec] --> B[Step 1: The Subtraction Test]
    B --> C[Step 2: Primitive Collapsing & Flag Pruning]
    C --> D[Step 3: The Cache & State Invalidation Probe]
    D --> E[Step 4: The 10% Minimum Viable Proposal]
    E --> F[Output: Simplification Scorecard & Minimalist Spec]

Step 1: The Subtraction Test (The 3 Deadly Questions) #

Apply these questions to every component in the proposal:

  1. The Ghost Problem Test: If we do nothing and ship zero lines of code, what actually breaks in production today?
  2. The 90/10 Rule: What 10% of this proposal delivers 90% of the actual user value? Can we discard the remaining 90% of the spec?
  3. The Accidental Complexity Probe: Is this feature solving a real user problem, or is it solving a problem introduced by an earlier bad abstraction?

Step 2: Primitive Collapsing & Surface Pruning #

Collapse multiple flags, commands, or data structures into single composable primitives:

Bloated Pattern (Before ❌)Collapsed Primitive (After ✅)Rationale
--page, --section, --index, --toc, #slugPositional URI path doc[#section]Unified resource addressability replaces 5 separate flags.
Separate read, load, refs, peek commandsSingle polymorphic load <target>Reduces agent decision entropy and CLI verb sprawl.
Configuration file + 12 env vars + CLI flagsDeterministic convention over configurationEliminates configuration drift and precedence bugs.
In-memory LRU cache + Disk cache + Remote syncFast on-the-fly streamingRaw operations in RAM (< 1 ms) make caching slower than compute.

Step 3: The Cache & State Invalidation Probe #

Whenever a proposal introduces caching, local state files, or background workers:

  • Calculate the Cache Paradox: Measure the cost of on-the-fly computation vs. cache serialization, disk I/O, hash verification, and invalidation race conditions.
  • Enforce Ephemeral Execution: If in-memory computation takes < 1 ms, strictly forbid persistent caching layers.

Step 4: The 10% Minimum Viable Proposal (MVP) #

Draft an alternative “Uno-Reverse Specification” that:

  • Achieves the core objective in <= 20% of the proposed lines of code.
  • Uses zero external dependencies or heavy frameworks.
  • Requires zero background daemons, zero state migrations, and zero cache management.

🛡️ Chesterton’s Fence: When NOT to Simplify #

Radical simplification is not reckless deletion. Before eliminating a mechanism, identify whether it represents Essential or Accidental complexity:

text
┌───────────────────────────────────────┬───────────────────────────────────────┐
│     NEVER PRUNE (Essential Safety)    │    ALWAYS PRUNE (Accidental Bloat)    │
├───────────────────────────────────────┼───────────────────────────────────────┤
│ • Concurrency locks & race guards     │ • Unbenchmarked caching layers        │
│ • Authentication & permission checks  │ • Generic abstract factories          │
│ • Input validation & sanitization     │ • Pluggable drivers for 1 provider    │
│ • Idempotency tokens & rollbacks      │ • Config flags for internal decisions │
│ • Explicit error handling boundaries  │ • Micro-agent coordination swarms     │
└───────────────────────────────────────┴───────────────────────────────────────┘

The Chesterton Gate: If you cannot explain why a defensive check or data field was originally added, you are forbidden from deleting it until you understand its failure mode.


📋 The Simplification Audit Scorecard #

Deliver all audit results in this standardized, high-signal markdown format:

markdown
# 🔄 Uno-Reverse Simplification Audit: [Topic / Proposal]

## 1. Executive Inversion Summary
- **Proposed Complexity**: [Summary of moving parts, services, and flags in original design]
- **Recommended Verdict**: [Prune / Collapse / Re-architect]
- **Potential Code Reduction**: ~X% (from ~Y LOC to ~Z LOC)

## 2. The Cut List (Items to Eliminate Immediately)
| Proposed Feature / Component | Reason for Elimination | What Happens Without It |
| :--- | :--- | :--- |
| [Feature A] | Speculative generalization | Nothing; solve with a single constant |
| [Feature B] | Cache paradox (I/O > Compute) | Scan on the fly in < 0.1 ms |

## 3. Collapsed Primitives
- **Instead of**: [List of disparate flags / commands]
- **Use**: [Single elegant primitive]

## 4. The Minimalist Reference Design
[Concrete, ultra-compact specification / code snippet implementing the 10% MVP]

## 5. Chesterton Boundary Assessment
- **Essential Complexity Retained**: [Security, safety, or concurrency checks kept intact]
- **Risk & Trade-off Assessment**: [Edge cases intentionally omitted and why the trade-off is sound]

🚫 Common Engineering Traps to Call Out #

  1. “What if the user wants X?” (Speculative Customization):
    • Uno-Reverse Response: “Wait until 3 distinct users actively request it in production before writing code for it.”
  2. “We might support other backends later” (Premature Extensibility):
    • Uno-Reverse Response: “Implement the concrete backend directly. Refactoring clean concrete code is 10x faster than maintaining unused abstractions.”
  3. “Let’s add a cache for performance” (Unbenchmarked Caching):
    • Uno-Reverse Response: “Benchmark the raw in-memory operation first. If it takes < 5 ms, a cache is tech debt, not an optimization.”
  4. “Let’s add a configuration flag” (Passing Design Decisions to Users):
    • Uno-Reverse Response: “Make the right design decision in the code. Every configuration flag is an abdication of architectural responsibility.”
  5. “Let’s spawn an agent swarm for this” (Multi-Agent Vanity):
    • Uno-Reverse Response: “If the steps are sequential, write a 15-line deterministic script. Keep agents for non-deterministic reasoning.”