--- name: ask-minimax description: > Delegate a file-heavy task to a MiniMax M3 sub-session. The sub-session reads and writes files directly; only a concise result returns to this session. Saves context and Anthropic tokens. Pass a task description as arguments, or run without args to be prompted. user_invocable: true allowed-tools: Read, Write, Bash(ask-minimax-run *), Bash(date *), Bash(rm -f *), Bash(test *), Bash(pwd) --- ask-minimax # /ask-minimax Skill Offload a file-heavy task to a MiniMax M3 sub-session. Large file contents stay out of this session — only the task prompt and a concise result summary flow back. ## Pre-gathered context ### Current date !`date +%Y-%m-%d` ## Instructions **Goal:** Run a scoped task in MiniMax so its file reads and writes never load into this context. You write a prompt file, invoke the sub-session, read the result file, and summarise. ### Step 0 — Verify profile readiness Run via Bash: ```bash test -f ~/.claude-oreillyit-minimax/provider.env && echo "minimax profile: ready" || echo "minimax profile: MISSING" ``` If MISSING, tell the user the profile is not configured and stop. ### Step 1 — Clarify the task Use `$ARGUMENTS` as the task description. If empty or incomplete, ask the user: - What should the sub-session do? (transform, extract, rewrite, summarise, generate?) - Which file paths should it read? (give absolute paths) - Where should it write output? (default: `/tmp/ask-minimax-result.md`) - Any constraints on format, length, or structure? Do **not** read the input files yourself — pass paths only. The sub-session reads them. ### Step 2 — Generate a timestamp Run the following via Bash and note the integer value as `TS`: ```bash date +%s ``` Use `TS` as a suffix on all temp files: `/tmp/ask-minimax--prompt.txt`, `/tmp/ask-minimax--result.md`, `/tmp/ask-minimax--stdout.txt`. ### Step 3 — Write the prompt file Use the Write tool to create `/tmp/ask-minimax--prompt.txt`. Substitute `` with the actual timestamp integer. Structure the content as: ``` You are running in non-interactive (-p) mode. Complete the following task and write your full response to the output file path specified below. Do not rely on stdout for structured output — use the Write tool. ## Task ## Files to read ## Output file Write your complete response to: /tmp/ask-minimax--result.md Use the Write tool to create that file. Overwrite if it already exists. ## Constraints - Read each input file fully before starting - Write the complete result to the output file - One-line stdout acknowledgement is fine; bulk content goes in the output file ``` Fill in the actual task description, file paths, and timestamp — no placeholders in the written file. ### Step 4 — Run the sub-session Execute via Bash (substitute `` with the actual value): ```bash ask-minimax-run \ --model MiniMax-M3 \ --allowedTools "Read,Write,Edit,Glob,Grep" \ --permission-mode acceptEdits \ -p "$(cat /tmp/ask-minimax--prompt.txt)" \ > /tmp/ask-minimax--stdout.txt 2>&1 ``` This runs synchronously. Warn the user if the task involves very large files — it may take a minute or two. Show the exit code after it completes. **Permissions:** do **not** pass `--dangerously-skip-permissions`. The sub-session is scoped by `--allowedTools` — only those tools run without a prompt. `--permission-mode acceptEdits` lets it write/edit files non-interactively within that allowlist without a blanket bypass. In headless `-p` mode any tool **outside** the allowlist is denied (the sub-session continues; it does not hang), so the allowlist is the security boundary — keep it minimal. **Adjusting `--allowedTools`**: Default covers read + write tasks. For read-only analysis, use `"Read,Glob,Grep"` (and drop `--permission-mode acceptEdits`). For heavy generation, keep `"Read,Write,Edit,Glob,Grep"`. If a task genuinely needs the sub-session to run commands, add a **scoped** Bash pattern (e.g. `Bash(pytest *)`) to the allowlist rather than reaching for the skip flag. ### Step 5 — Collect and present results 1. Read `/tmp/ask-minimax--result.md` using the Read tool 2. If not found: read `/tmp/ask-minimax--stdout.txt` as fallback 3. Present a concise summary to the user — do **not** dump the full file contents into the conversation 4. Tell the user the result file path so they can read it themselves if they want the full output ### Step 6 — Clean up Remove the prompt and stdout temp files (keep the result file): ```bash rm -f /tmp/ask-minimax--prompt.txt /tmp/ask-minimax--stdout.txt ``` ## Usage patterns - **Large file transformation**: Pass the source path; sub-session reads, transforms, writes output - **Multi-file summarisation**: Pass all file paths; get a single consolidated result - **Bulk generation**: Describe what to write and where; full generated content lands in the result file without touching this context - **Format conversion**: Pass input path and target format; result file gets the converted content