---
description: "Model compatibility guide: prompt hierarchy, M3-first model selection, tool discipline, read-before-edit safety, and context control across models."
alwaysApply: false
---

# Transferable Agent Behavior (M3-first, model-resilient)

This repo is tuned for MiniMax M3 first. M3 is a generational shift: 1M-token MSA context, native multimodal input (text, image, video), and higher agentic and coding benchmarks.

The purpose of this file is to define the transferable execution behavior the agent should copy across models: tool-first work, read-before-edit discipline, short prompts, and context-aware problem solving that also maps well to strong GPT/Codex/Composer-style coding agents.

## Prompt Hierarchy

Treat the current environment as the source of truth:
- system instructions and exposed tools win
- always-on rules should stay short, durable, and canonical
- requestable rules should carry runtime-specific guidance
- user instructions still define the task

Do not assume an older rule or prompt shape is still valid just because it appears in this repo.
Prefer a single always-on execution spine over duplicated policy spread across multiple files.

## Model Selection

| Need | Default | Why |
|------|---------|-----|
| Long context (multi-file refactor, transcript analysis, large retrieval pack, full-repo synthesis) | `MiniMax-M3` | 1M-token MSA context |
| Visual-fidelity work, design parity, error UI triage, screenshot-driven dev | `MiniMax-M3` | Native multimodal input (text, image, video) |
| Deep agentic / coding (SWE-Bench-class tasks, long-horizon planning) | `MiniMax-M3` | Higher agentic and coding benchmarks |
| Anything where the user asks for "frontier" by name | `MiniMax-M3` | Positioned as the new frontier default |

When the active model is **not** M3 (for example `composer-2.5`, GPT, or Claude), the always-on core continues to apply — tool discipline, read-before-edit, scope control, solver loop, status taxonomy. The M3-specific sections (long-context discipline, multimodal input discipline) become inert, and the agent must not promise multimodal or 1M-context behavior. Confirm the model's actual capabilities from the current runtime before relying on them.

## Main Failure Modes

The most common failures are:
- writing plausible prose instead of using tools
- guessing file contents instead of reading them
- teaching stale tool names as if they were universal
- overloading the prompt with duplicate process text
- on M3, over-loading context with raw search/fetch output instead of compressing (see `minimax-m3-long-context`)
- on M3, making visual claims without re-reading the actual attached image/frame (see `minimax-m3-multimodal-input`)

## Tool Discipline

- If the prompt exposes a tool for the action, prefer that tool over shell.
- Follow the exact tool schema shown by the environment.
- Batch independent reads and searches when helpful.
- Keep commentary short; spend prompt budget on execution, not narration.

## Read-Before-Edit

Canonical workflow lives in the always-on core **Code Discipline** section. In short:

```text
1. Read the target file in the current session
2. Base the change on exact contents
3. Use the current edit primitive
4. Verify with follow-up reads, build, tests, browser checks, shell output, or multimodal-grounded re-reads
```

If the environment offers a patch or search-replace edit tool, prefer it for focused edits (Composer-style agents often expose `StrReplace`; other surfaces may use `ApplyPatch` or similar).

## Version Handling

- Never hardcode fast-moving versions in rules.
- Use web search with the actual current month and year when versions matter.
- Do not leave placeholders such as `[current year]` in the query.
- Before adding a new package, framework, or toolchain, verify the latest stable version, compatibility, and official setup path against current authoritative sources.
- Do not describe guidance as current, official, or best practice unless it is backed by those sources.

## Context Management

- Read only what is needed for the task.
- Prefer targeted searches over broad scans.
- Keep durable lessons, not raw output, in active context.
- For large work, push detailed procedures into requestable rules or skills instead of the always-on core.
- On M3, with 1M tokens available, still compress after each iteration — see `minimax-m3-long-context`.
