Learn how to use the ANSI formatter MCP tools to create beautifully formatted terminal output for AskUserQuestion prompts.
Uses XML markup to create beautifully formatted terminal output with badges, boxes, tables, and other visual components. Automatically triggered when you need to display structured information like issue triage, chat previews, timelines, or progress indicators in AskUserQuestion prompts.
/plugin marketplace add alexisvincent/mia/plugin install lops@miaThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Learn how to use the ANSI formatter MCP tools to create beautifully formatted terminal output for AskUserQuestion prompts.
There are two versions of the ANSI formatter:
Tool Name: format_ansi_declarative (via MCP: mcp__mia-local__format_ansi_declarative or mcp__plugin_lops_mia__format_ansi_declarative)
Purpose: Convert XML markup into ANSI-formatted terminal output using code-based rendering. Fast, deterministic, and free.
Parameters:
xml (required): XML markup describing the desired outputReturns: { formatted: string } - The ANSI-formatted string ready to use
Benefits:
Tool Name: format_ansi (via MCP: mcp__mia-local__format_ansi)
Purpose: Convert XML markup into ANSI-formatted terminal output using LLM interpretation.
Parameters:
xml (required): XML markup describing the desired outputcontext (optional): Additional context or instructions for the formatterReturns: { formatted: string } - The ANSI-formatted string ready to use
Note: Use this version only if you need the context parameter for special formatting instructions.
Priority Badges:
<badge type="priority" value="1"/> <!-- URGENT (red) -->
<badge type="priority" value="2"/> <!-- HIGH (red) -->
<badge type="priority" value="3"/> <!-- MEDIUM (yellow) -->
<badge type="priority" value="4"/> <!-- LOW (gray) -->
State Badges:
<badge type="state" value="In Progress"/>
<badge type="state" value="Todo"/>
<badge type="state" value="Backlog"/>
<!-- Any state name works -->
Action Badges:
<badge type="action" value="add_comment"/>
<badge type="action" value="update_description"/>
<badge type="action" value="update_title"/>
<badge type="action" value="change_state"/>
<badge type="action" value="add_labels"/>
<badge type="action" value="set_estimate"/>
<badge type="action" value="link_parent"/>
Basic Issue Display (2 lines: issue + metadata):
<issue
id="LOP-123"
title="Fix authentication bug"
state="In Progress"
priority="2"
labels="bug, security"/>
New Issue (use id="NEW"):
<issue
id="NEW"
title="Book dentist appointment"
summary="Schedule appointment this week"/>
Simple Box:
<box color="blue" title="Section Title">
Content line 1
Content line 2
</box>
Available Colors:
blue - Message previews, current issueyellow - Existing issues, clarify analysismagenta - Recommendationscyan - Related issues, primary infogreen - Success/completiongray - Secondary/neutralExisting Issues Box:
<existing-issues-box>
<issue id="LOP-45" title="Finish report" state="In Progress" priority="2"/>
<issue id="LOP-67" title="Review contracts" state="Todo"/>
</existing-issues-box>
Current Issue Box:
<current-issue-box
id="LOP-123"
title="Fix login bug"
state="Triage"
priority="1"
description="Users can't log in after password reset."/>
Related Issues Box:
<related-issues-box>
<issue
id="LOP-100"
title="Similar auth issue"
state="Done"
relationship="Similar"/>
<issue
id="LOP-200"
title="Parent epic"
state="In Progress"
relationship="Possible Parent"/>
</related-issues-box>
Clarify Analysis Box:
<clarify-analysis-box
actionable="Yes"
type="Action"
definition="Fix authentication bug preventing login after password reset"/>
Recommendations Box (Chat Triage Variant):
<recommendations-box>
<recommendation
issue="LOP-45"
title="Add Q4 projections"
actions="add_comment"
summary="Finance needs extra section on Q4 projections."/>
<recommendation
issue="NEW"
title="Book dentist appointment"
summary="Schedule this week."/>
</recommendations-box>
Recommendations Box (Linear Triage Variant):
<recommendations-box type="linear">
<change action="update_title" value="Fix authentication bug in login flow"/>
<change action="update_description"/>
<change action="change_state" value="Todo"/>
<change action="add_labels" value="bug, security, backend"/>
<change action="set_estimate" value="5 points (Large, 2-4 hours)"/>
<summary>Title clarified, added security context, sized as large task</summary>
</recommendations-box>
Message Box (Chat preview):
<message-box chat="Alice" type="dm">
<message
date="Jan 10"
time="14:30"
sender="Them"
processed="true">
Can you review the contract?
</message>
<message
date="Jan 11"
time="09:00"
sender="You"
processed="false"
highlight="by EOD">
Will do by EOD
</message>
</message-box>
Message Box Types:
type="dm" - Direct message (1-on-1)type="group" - Group chattype="self" - Notes to selfMessage Attributes:
date - Date string (e.g., "Jan 10")time - Time string (e.g., "14:30")sender - "You", "Them", or person nameprocessed - "true" for historical, "false" for new/unprocessedhighlight (optional) - Text to highlight in bold bright whiteGreat for structured data comparison (3-5 columns max):
<table>
<header>
<col>Migration</col>
<col>Size</col>
<col>Risk</col>
<col>Status</col>
</header>
<row>
<col id="001_users">001_users</col>
<col>2.3 MB</col>
<col><badge type="priority" value="4"/></col>
<col><badge type="state" value="Ready"/></col>
</row>
</table>
Attributes:
header - Optional header row (auto-bold)col - Table cellcol[id="..."] - Make cell green (like ID highlighting)Show sequential processes with time context:
<timeline>
<timescale start="09:00" interval="15" count="4"/>
<event time="09:00" status="complete" duration="5 min">BUILD</event>
<event time="09:08" status="complete" duration="8 min">TEST</event>
<event time="09:20" status="in-progress">STAGING</event>
</timeline>
Attributes:
timescale[start] - Starting time (e.g., "09:00")timescale[interval] - Minutes between markerstimescale[count] - Number of time markersevent[time] - Start time for eventevent[status] - "complete", "in-progress", "pending", "failed"event[duration] - Optional duration labelShow multi-step workflows (5-7 steps max):
<progress>
<step status="complete">Initialize</step>
<step status="complete">Validate</step>
<step status="current">Process</step>
<step status="pending">Review</step>
<step status="pending">Deploy</step>
</progress>
Attributes:
step[status] - "complete", "current", "pending", "failed"Alert boxes with severity levels (use double-line for critical only):
<alert severity="critical" title="Database connection pool exhausted">
<id>ALERT-001</id>
<triggered>3 minutes ago</triggered>
<affected>Production DB (us-west-2)</affected>
</alert>
<alert severity="warning" title="High memory usage (87%)">
<id>ALERT-002</id>
<triggered>12 minutes ago</triggered>
<affected>app-server-03</affected>
</alert>
Attributes:
alert[severity] - "critical", "warning", "info"alert[title] - Alert messageid - Alert identifiertriggered - When the alert firedaffected - What system/component is affectedShow file changes with line numbers (limit to 10-15 lines):
<diff file="package.json">
<line number="12" type="unchanged"> "dependencies": {</line>
<line number="13" type="removed"> "react": "^17.0.2",</line>
<line number="13" type="added"> "react": "^18.2.0",</line>
<line number="14" type="removed"> "react-dom": "^17.0.2",</line>
<line number="14" type="added"> "react-dom": "^18.2.0",</line>
<line number="15" type="unchanged"> "axios": "^1.6.0",</line>
</diff>
Attributes:
diff[file] - Optional filename headerline[number] - Line number in fileline[type] - "unchanged", "removed", "added"Show boolean states across environments (3-5 columns max):
<matrix>
<columns>
<col>DEV</col>
<col>STAGE</col>
<col>PROD</col>
</columns>
<row feature="Dark Mode">
<cell state="enabled"/>
<cell state="enabled"/>
<cell state="disabled"/>
</row>
<row feature="Analytics 2.0">
<cell state="enabled"/>
<cell state="enabled"/>
<cell state="partial" value="50%"/>
</row>
</matrix>
Attributes:
col - Column header (environment, role, etc.)row[feature] - Row label (feature name, permission, etc.)cell[state] - "enabled", "disabled", "partial"cell[value] - Optional value for partial stateShow dates with event highlights:
<calendar month="November" year="2025">
<week>
<day date="11" current="true">1 event</day>
<day date="12"/>
<day date="13">2 events</day>
<day date="14"/>
<day date="15">1 event</day>
</week>
<week>
<day date="21" importance="high">1 critical</day>
</week>
</calendar>
Attributes:
calendar[month] - Month namecalendar[year] - Yearday[date] - Day numberday[current] - "true" for todayday[importance] - "normal", "high" (affects color)Multiple metrics in organized cells (2-4 cells per row):
<dashboard>
<cell title="SPRINT" color="green">
<metric><badge type="state" value="73%"/></metric>
<detail>22 of 30</detail>
<detail>points</detail>
</cell>
<cell title="REVIEWS" color="yellow">
<metric><badge type="state" value="8 open"/></metric>
<detail>3 urgent</detail>
<detail>5 waiting</detail>
</cell>
<cell title="DEPLOYS" color="cyan">
<metric><badge type="state" value="3 today"/></metric>
<detail>2 planned</detail>
<detail>1 hotfix</detail>
</cell>
</dashboard>
Attributes:
cell[title] - Cell header (bold, colored)cell[color] - "green", "yellow", "cyan", "red", "gray"metric - Primary metric (usually a badge)detail - Supporting details (1-3 lines)All examples use the declarative version (format_ansi_declarative). The LLM version (format_ansi) has the same XML syntax but adds an optional context parameter.
const result = await mcp__mia_local__format_ansi_declarative({
xml: '<badge type="priority" value="1"/>'
})
// result.formatted: "\u001b[41m\u001b[1m\u001b[38;5;231m URGENT \u001b[0m"
const result = await mcp__mia_local__format_ansi_declarative({
xml: `<issue
id="LOP-456"
title="Update documentation"
state="Todo"
priority="3"/>`
})
// Returns formatted 2-line issue display
const result = await mcp__mia_local__format_ansi_declarative({
xml: `
<message-box chat="Alice" type="dm">
<message date="Jan 11" time="09:00" sender="You" processed="false">
Will review by EOD
</message>
</message-box>
<existing-issues-box>
<issue id="LOP-45" title="Quarterly report" state="In Progress" priority="2"/>
</existing-issues-box>
<recommendations-box>
<recommendation
issue="LOP-45"
title="Add Q4 section"
actions="add_comment"
summary="Finance feedback: Need Q4 projections section."/>
</recommendations-box>
`
})
// Returns complete formatted prompt with all sections
const result = await mcp__mia_local__format_ansi_declarative({
xml: `
<current-issue-box
id="LOP-999"
title="Fix login bug"
state="Triage"
priority="1"
description="Users can't log in after password reset."/>
<clarify-analysis-box
actionable="Yes"
type="Action"
definition="Fix auth bug preventing login after password reset"/>
<recommendations-box type="linear">
<change action="update_title" value="Fix authentication in password reset flow"/>
<change action="change_state" value="Todo"/>
<change action="add_labels" value="bug, security"/>
<summary>Clarified title and added security label</summary>
</recommendations-box>
`
})
// Returns complete linear triage prompt
The context parameter is only available on the LLM version (format_ansi). Use it for special formatting instructions:
// Only use format_ansi (not format_ansi_declarative) when you need context
await mcp__mia_local__format_ansi({
xml: '<issue id="LOP-123" title="..." state="Todo"/>',
context: 'This is for a mobile app project, emphasize urgency'
})
The tool handles complete multi-section prompts. Separate sections with blank lines in the XML for clarity.
In message boxes, only highlight the most important actionable terms:
<message highlight="review contract">Can you review contract by Friday?</message>
The tool returns a JSON object with a formatted field containing the ANSI-formatted string:
{
"formatted": "\u001b[0m\u001b[34m┌─ Title ──......"
}
Extract the formatted field and use it directly in your AskUserQuestion calls or other terminal output.
If the XML is malformed or uses undefined components, the tool will do its best to interpret and format the content. Always validate your XML structure before calling the tool in production.
format_ansi_declarative)format_ansi)context parameter for special formatting instructionsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.