Output Formatter
Context
Activate this skill when the user requires structured, well-formatted output or when the response format matters as much as the content. Use this skill when:
- The user requests a specific output format (JSON, table, markdown, etc.)
- The response will be consumed by another system or tool
- The user needs data presented in a scannable, structured way
- Generating reports, documentation, API responses, or configuration files
- Any context where formatting inconsistencies would reduce clarity or break tooling
Do not use for informal conversational responses where rigid formatting would feel unnatural or counterproductive.
Instructions
Step 1: Determine the Output Format
Assess the content type and user request to select the appropriate format:
| Content Type |
Recommended Format |
| Structured data / API payloads |
JSON |
| Comparisons / metrics / features |
Markdown table |
| Prose with structure |
Markdown with headings |
| Code snippets |
Fenced code blocks with language tag |
| Mixed content |
Combination with clear separators |
| Configuration / data files |
YAML, TOML, or JSON as appropriate |
Step 2: Apply Markdown Rules
When using markdown:
Heading hierarchy:
- Use
# for the document title (only once, at the top)
- Use
## for major sections
- Use
### for subsections
- Never skip levels (e.g.,
# directly to ###)
- Do not use more than 3 heading levels in a single response unless the document is long-form
Lists:
- Use
- for unordered lists (not * or +)
- Use
1. for ordered lists
- Nested lists: indent 2 spaces per level
- Keep list items to one line where possible; break long items across lines
Emphasis:
- Use
**bold** for key terms, labels, and emphasis
- Use
`backticks` for inline code, variable names, and technical terms
- Never use
_underscores_ for emphasis (can conflict with markdown in some renderers)
Horizontal rules:
- Use
--- to separate major sections
- Do not use horizontal rules between every paragraph
Step 3: Apply JSON Rules
When producing JSON:
- Validate that the output is parseable JSON (no trailing commas, no comments, proper quoting)
- Use consistent indentation (2 spaces, not tabs)
- Quote all keys — never use unquoted keys
- Use
null for missing values, never omit the key
- For arrays of objects, ensure every object has the same keys in the same order
- Wrap in a fenced code block with
json language tag
Step 4: Apply Table Rules
When producing markdown tables:
- Always include a header row
- Always include a separator row (
|---|---|)
- Align columns logically: numbers right-aligned, text left-aligned
- Keep cell content short — tables are for scanning, not reading
- Use
N/A or — for empty cells, never leave them blank
- Limit to 5–7 columns maximum for readability
- For wide tables, consider splitting into multiple focused tables
Step 5: Apply Code Block Rules
When producing code:
- Always use fenced code blocks with triple backticks
- Always include the language tag (e.g.,
python, bash, ```json)
- For multi-line code, ensure consistent indentation
- Add brief comments for non-obvious logic
- Keep code examples minimal and focused — don't paste entire files
- When showing diffs or changes, clearly mark what is new vs. existing
Step 6: Final Validation
Before outputting, run through this checklist:
- Does the format match what the user requested?
- Are all headings, tables, and code blocks properly closed?
- Is the hierarchy consistent (no skipped heading levels)?
- Is the JSON parseable (if applicable)?
- Would a machine be able to consume this without errors?
Constraints
- No mixed formatting within a single element. A table cell must not contain a code block. A list item must not contain a nested table unless explicitly requested.
- Consistent whitespace. Use the same indentation style throughout. No mixed tabs and spaces.
- No raw HTML unless explicitly requested. Stick to standard markdown syntax.
- JSON must always be valid. Invalid JSON is never acceptable — validate before outputting.
- Tables must always have headers. Headerless tables are forbidden.
- Code blocks must always have a language tag. Untagged code blocks are forbidden.
- Respect the user's format request. If the user says "give me JSON," give JSON — not markdown wrapping JSON. Format selection is user-driven, not agent-driven.
- Length discipline. Use formatting to reduce verbosity, not increase it. If a table replaces a 20-line list, that is the correct outcome.
Examples
Example 1: Structured API Response
User: "Give me a JSON schema for a user profile endpoint."
Output:
{
"endpoint": "/api/v1/users/{id}/profile",
"method": "GET",
"response": {
"schema": {
"id": "string (UUID)",
"email": "string",
"display_name": "string",
"avatar_url": "string (URL, nullable)",
"role": "string (enum: admin, editor, viewer)",
"created_at": "string (ISO 8601)",
"updated_at": "string (ISO 8601)",
"metadata": {
"bio": "string (max 500 chars)",
"location": "string (nullable)",
"website": "string (URL, nullable)"
}
}
},
"errors": {
"404": "User not found",
"401": "Authentication required",
"403": "Insufficient permissions"
}
}
Example 2: Feature Comparison Table
User: "Compare Redis, Memcached, and DynamoDB DAX for caching."
Output:
| Feature |
Redis |
Memcached |
DynamoDB DAX |
| Data types |
Strings, lists, sets, hashes, streams |
Strings only |
DynamoDB items |
| Persistence |
Optional (RDB/AOF) |
None (in-memory only) |
Transparent (DynamoDB-backed) |
| Replication |
Primary-replica |
None |
Managed by AWS |
| Max memory |
Limited by available RAM |
Limited by available RAM |
Tied to DynamoDB table |
| Latency (P99) |
<1ms |
<1ms |
~1–3ms |
| Multi-region |
Enterprise feature |
Not supported |
Native via DynamoDB Global Tables |
| Deployment |
Self-hosted or Managed (ElastiCache) |
Self-hosted or Managed (ElastiCache) |
Fully managed (AWS only) |
| Best for |
Complex caching, pub/sub, session store |
Simple key-value, LRU caching |
DynamoDB-native workloads |
Key takeaway: Redis is the most versatile option. Memcached is the simplest for pure LRU caching. DynamoDB DAX is the right choice only if your primary datastore is already DynamoDB.
1---2name: output-formatter3description: Format responses into structured, well-organized output including JSON, tables, markdown, YAML, and more. Use when output format is as important as content.4---56# Output Formatter78## Context910Activate this skill when the user requires **structured, well-formatted output** or when the response format matters as much as the content. Use this skill when:1112- The user requests a specific output format (JSON, table, markdown, etc.)13- The response will be consumed by another system or tool14- The user needs data presented in a scannable, structured way15- Generating reports, documentation, API responses, or configuration files16- Any context where formatting inconsistencies would reduce clarity or break tooling1718**Do not use** for informal conversational responses where rigid formatting would feel unnatural or counterproductive.1920## Instructions2122### Step 1: Determine the Output Format23Assess the content type and user request to select the appropriate format:2425| Content Type | Recommended Format |26|---|---|27| Structured data / API payloads | JSON |28| Comparisons / metrics / features | Markdown table |29| Prose with structure | Markdown with headings |30| Code snippets | Fenced code blocks with language tag |31| Mixed content | Combination with clear separators |32| Configuration / data files | YAML, TOML, or JSON as appropriate |3334### Step 2: Apply Markdown Rules35When using markdown:3637**Heading hierarchy:**38- Use `#` for the document title (only once, at the top)39- Use `##` for major sections40- Use `###` for subsections41- Never skip levels (e.g., `#` directly to `###`)42- Do not use more than 3 heading levels in a single response unless the document is long-form4344**Lists:**45- Use `-` for unordered lists (not `*` or `+`)46- Use `1.` for ordered lists47- Nested lists: indent 2 spaces per level48- Keep list items to one line where possible; break long items across lines4950**Emphasis:**51- Use `**bold**` for key terms, labels, and emphasis52- Use `` `backticks` `` for inline code, variable names, and technical terms53- Never use `_underscores_` for emphasis (can conflict with markdown in some renderers)5455**Horizontal rules:**56- Use `---` to separate major sections57- Do not use horizontal rules between every paragraph5859### Step 3: Apply JSON Rules60When producing JSON:6162- Validate that the output is parseable JSON (no trailing commas, no comments, proper quoting)63- Use consistent indentation (2 spaces, not tabs)64- Quote all keys — never use unquoted keys65- Use `null` for missing values, never omit the key66- For arrays of objects, ensure every object has the same keys in the same order67- Wrap in a fenced code block with `json` language tag6869### Step 4: Apply Table Rules70When producing markdown tables:7172- Always include a header row73- Always include a separator row (`|---|---|`)74- Align columns logically: numbers right-aligned, text left-aligned75- Keep cell content short — tables are for scanning, not reading76- Use `N/A` or `—` for empty cells, never leave them blank77- Limit to 5–7 columns maximum for readability78- For wide tables, consider splitting into multiple focused tables7980### Step 5: Apply Code Block Rules81When producing code:8283- Always use fenced code blocks with triple backticks84- Always include the language tag (e.g., ```python, ```bash, ```json)85- For multi-line code, ensure consistent indentation86- Add brief comments for non-obvious logic87- Keep code examples minimal and focused — don't paste entire files88- When showing diffs or changes, clearly mark what is new vs. existing8990### Step 6: Final Validation91Before outputting, run through this checklist:92- Does the format match what the user requested?93- Are all headings, tables, and code blocks properly closed?94- Is the hierarchy consistent (no skipped heading levels)?95- Is the JSON parseable (if applicable)?96- Would a machine be able to consume this without errors?9798## Constraints991001. **No mixed formatting within a single element.** A table cell must not contain a code block. A list item must not contain a nested table unless explicitly requested.1012. **Consistent whitespace.** Use the same indentation style throughout. No mixed tabs and spaces.1023. **No raw HTML unless explicitly requested.** Stick to standard markdown syntax.1034. **JSON must always be valid.** Invalid JSON is never acceptable — validate before outputting.1045. **Tables must always have headers.** Headerless tables are forbidden.1056. **Code blocks must always have a language tag.** Untagged code blocks are forbidden.1067. **Respect the user's format request.** If the user says "give me JSON," give JSON — not markdown wrapping JSON. Format selection is user-driven, not agent-driven.1078. **Length discipline.** Use formatting to reduce verbosity, not increase it. If a table replaces a 20-line list, that is the correct outcome.108109## Examples110111### Example 1: Structured API Response112113**User:** "Give me a JSON schema for a user profile endpoint."114115**Output:**116117```json118{119 "endpoint": "/api/v1/users/{id}/profile",120 "method": "GET",121 "response": {122 "schema": {123 "id": "string (UUID)",124 "email": "string",125 "display_name": "string",126 "avatar_url": "string (URL, nullable)",127 "role": "string (enum: admin, editor, viewer)",128 "created_at": "string (ISO 8601)",129 "updated_at": "string (ISO 8601)",130 "metadata": {131 "bio": "string (max 500 chars)",132 "location": "string (nullable)",133 "website": "string (URL, nullable)"134 }135 }136 },137 "errors": {138 "404": "User not found",139 "401": "Authentication required",140 "403": "Insufficient permissions"141 }142}143```144145### Example 2: Feature Comparison Table146147**User:** "Compare Redis, Memcached, and DynamoDB DAX for caching."148149**Output:**150151| Feature | Redis | Memcached | DynamoDB DAX |152|---|---|---|---|153| **Data types** | Strings, lists, sets, hashes, streams | Strings only | DynamoDB items |154| **Persistence** | Optional (RDB/AOF) | None (in-memory only) | Transparent (DynamoDB-backed) |155| **Replication** | Primary-replica | None | Managed by AWS |156| **Max memory** | Limited by available RAM | Limited by available RAM | Tied to DynamoDB table |157| **Latency (P99)** | <1ms | <1ms | ~1–3ms |158| **Multi-region** | Enterprise feature | Not supported | Native via DynamoDB Global Tables |159| **Deployment** | Self-hosted or Managed (ElastiCache) | Self-hosted or Managed (ElastiCache) | Fully managed (AWS only) |160| **Best for** | Complex caching, pub/sub, session store | Simple key-value, LRU caching | DynamoDB-native workloads |161162**Key takeaway:** Redis is the most versatile option. Memcached is the simplest for pure LRU caching. DynamoDB DAX is the right choice only if your primary datastore is already DynamoDB.