
testing-mastracode-tui
Testing mastracode TUI features interactively in Konsole. Covers model configuration, thread lifecycle, task state isolation, and common blockers.
- Installs
- 40
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/mastra-ai/mastra --skill testing-mastracode-tui- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads testing-mastracode-tui automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Testing Mastracode TUI
Guide for interactive testing of mastracode's terminal UI in Konsole.
Devin Secrets Needed
OPENROUTER_API_KEY— for using OpenRouter as a custom provider when Anthropic/OpenAI keys are unavailable
Prerequisites
-
Build mastracode and its dependencies:
cd /home/ubuntu/repos/mastra COREPACK_ENABLE_STRICT=0 pnpm build:mastracodeThis may take a few minutes. If
pnpmhas corepack issues, install directly:npm install -g pnpm@10.11.0 -
If the build fails due to pre-existing DTS errors in
@mastra/coreor@mastra/memory, use--continueto let downstream packages (including mastracode) still build:COREPACK_ENABLE_STRICT=0 pnpm turbo build --filter ./mastracode --continue -
If unit tests fail with missing
@mastra/core/workspace, runpnpm build:corefirst.
Configuring a Custom Provider (OpenRouter)
If you don't have a direct Anthropic/OpenAI API key, configure OpenRouter as a custom provider:
-
Edit
~/.local/share/mastracode/settings.json:{ "customProviders": [ { "name": "OpenRouter", "url": "https://openrouter.ai/api/v1", "apiKey": "<OPENROUTER_API_KEY value>", "models": ["minimax/minimax-m2.7"] } ], "models": { "activeModelPackId": "custom:Custom", "modeDefaults": { "build": "openrouter/minimax/minimax-m2.7", "plan": "openrouter/minimax/minimax-m2.7", "fast": "openrouter/minimax/minimax-m2.7" } }, "customModelPacks": [ { "name": "Custom", "models": { "build": "openrouter/minimax/minimax-m2.7", "plan": "openrouter/minimax/minimax-m2.7", "fast": "openrouter/minimax/minimax-m2.7" }, "createdAt": "2026-01-01T00:00:00.000Z" } ] } -
After launching mastracode, you may also need to activate the custom pack via
/models→ select "Custom" → "Activate". -
Verify the status bar at the bottom shows the correct model (e.g.,
build openrouter/minimax/minimax-m2.7).
Launching Mastracode
cd /home/ubuntu/repos/mastra/mastracode
COREPACK_ENABLE_STRICT=0 pnpm cli
On first launch, mastracode may show a setup wizard. Select "Skip" to proceed to the main TUI without configuring models interactively.
Key TUI Commands
| Command | Action |
|---|---|
/new | Create a new empty thread |
/threads | Open thread selector (↑↓ navigate, Enter select) |
/clone | Clone current thread |
/models | Switch model pack |
/help | Show all available commands |
Programmatic Rendering Tests
For visual/rendering bugs (e.g., border alignment, padding, wrapping), writing a quick tsx script that directly renders the component is more reliable than visual inspection alone:
cd /home/ubuntu/repos/mastra/mastracode
npx tsx test-script.ts
Key approach:
- Import the component directly (e.g.,
UserMessageComponentfrom./src/tui/components/user-message.js) - Render at specific widths and strip ANSI codes to measure visible character widths
- Assert all lines have identical visible width (for bordered components)
- Test at multiple terminal widths (40, 60, 80, 100, 120+) to catch edge cases
- Filter out trailing empty lines from
Spacercomponents when measuring - For before/after comparisons, simulate the old logic inline to confirm the bug exists
This approach catches bugs that are hard to see visually and provides concrete pass/fail evidence.
Testing Thread State Isolation
The key scenario for thread state testing:
-
Generate tasks: Ask the model to use the
task_writetool explicitly. Some models (e.g., minimax) may not call it automatically — you may need to say something like: "Please use the task_write tool to create a task list with 3 items: Fix login bug, Add unit tests, Update docs" -
Verify tasks visible: Look for the "Tasks [0/N completed]" section with ○/▶/✓ icons between the status line and the editor input.
-
Test
/new: The task progress component should completely disappear. The screen should show only "Ready for new conversation" and an empty input. -
Test
/threadsswitch: Switch back to the original thread — messages and tasks should restore correctly. -
Test
/clone: Cloned threads should start with empty tasks (tasks are ephemeral, not persisted to clones).
Common Issues
- Observational memory errors: You may see errors about
GOOGLE_GENERATIVE_AI_API_KEYfor the OM model. Fix this by setting the OM model to an OpenRouter model via/omor in settings.json (models.omModelOverride). Configure the OM model if you expect observation to trigger during testing. - Model not calling tools: Less capable models may not use mastracode's tool system. Explicitly instruct them to use specific tools by name.
- Status bar shows wrong model: After changing settings.json, you may need to use
/modelsin the TUI to activate the custom pack. - Build failures: If
pnpm clifails with module resolution errors, runpnpm build:mastracode(or with--continue) from the repo root to build all transitive dependencies. - User message rendering without LLM: The user message box renders immediately on Enter, before any LLM response. You can test rendering bugs without a working LLM connection — just submit a message and inspect the bordered box.
Running Unit Tests
cd /home/ubuntu/repos/mastra
COREPACK_ENABLE_STRICT=0 pnpm --filter mastracode exec vitest run src/tui/__tests__/
Some pre-existing test failures may exist in the broader test suite — focus on tests relevant to the feature being verified.
FAQ
What does the testing-mastracode-tui skill do?
Testing mastracode TUI features interactively in Konsole. Covers model configuration, thread lifecycle, task state isolation, and common blockers.
How do I install testing-mastracode-tui?
Run npx skills add https://github.com/mastra-ai/mastra --skill testing-mastracode-tui in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/testing-mastracode-tui/ (personal) or .claude/skills/testing-mastracode-tui/ (project).
Which AI agents can use testing-mastracode-tui?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is testing-mastracode-tui safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains testing-mastracode-tui?
It is published by mastra-ai in mastra-ai/mastra, and it is an official skill from the maker of the technology it covers. It has 40 recorded installs.
More from mastra-ai/mastra
react-best-practices
mastra-ai/mastra
React performance optimization guidelines from Mastra Engineering. This skill should be used when writing, reviewing, or refactoring React code to ensure optimal performance patterns. Triggers on tasks involving React components, data fetching, bundle optimization, or performance improvements.
ralph-plan
mastra-ai/mastra
Interactive planning assistant that helps create focused, well-structured ralph-loop commands through collaborative conversation
smoke-test
mastra-ai/mastra
Create a Mastra project using create-mastra and smoke test the studio in Chrome using Chrome MCP server
e2e-tests-studio
mastra-ai/mastra
REQUIRED when modifying any file in packages/playground-ui or packages/playground. Triggers on: React component creation/modification/refactoring, UI changes, new playground features, bug fixes affecting studio UI. Generates Playwright E2E tests that validate PRODUCT BEHAVIOR, not just UI states.
tailwind-best-practices
mastra-ai/mastra
Tailwind CSS styling guidelines for Mastra Playground UI. This skill should be used when writing, reviewing, or refactoring styling code in packages/playground-ui and packages/playground to ensure design system consistency. Triggers on tasks involving Tailwind classes, component styling, or design tokens.
mastra-docs
mastra-ai/mastra
Open the skill to read its SKILL.md instructions.
Popular testing & qa skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
grilling
mattpocock/skills
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
migrate-to-shoehorn
mattpocock/skills
Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.
run-train
lllllllama/rigorpilot-skills
Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.
test-driven-development
obra/superpowers
Use when implementing any feature or bugfix, before writing implementation code
finishing-a-development-branch
obra/superpowers
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work