All skills
microsoft avatar

/markdown-token-optimizer

@5829570 official

Analyzes markdown files for token efficiency. TRIGGERS: optimize markdown, reduce tokens, token count, token bloat, too many tokens, make concise, shrink file, file too large, optimize for AI, token efficiency, verbose markdown, reduce file size

Use this Skill: https://skilld.dev/gh/microsoft/github-copilot-for-azure/markdown-token-optimizer

This session only. Nothing lands on disk.

referencesOPTIMIZATION-PATTERNS.md

≈827 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Optimization Patterns

Techniques for reducing token count while maintaining clarity.

Content Restructuring

Move Details to References

Before (in SKILL.md):

## API Reference

| Endpoint | Method | Parameters | Response |
|----------|--------|------------|----------|
| /users | GET | limit, offset | User[] |
| /users/:id | GET | id | User |
| /users | POST | name, email | User |
... (50 more rows)

After:

## API Reference

See [references/API.md](references/API.md) for the complete endpoint list.

Savings: 200+ tokens for large tables

Use Reference Links for Repeated Content

Before:

Run `az login --tenant YOUR_TENANT_ID` to authenticate.
...
Make sure you've run `az login --tenant YOUR_TENANT_ID` first.
...
If not authenticated, use `az login --tenant YOUR_TENANT_ID`.

After:

Run `az login --tenant YOUR_TENANT_ID` to authenticate.
...
Make sure you've authenticated (see above).
...
If not authenticated, see the authentication step above.

Savings: ~20 tokens per removed duplicate

Text Optimization

Replace Verbose Phrases

Verbose Concise Savings
"In order to" "To" 2 tokens
"It is important to note that" "Note:" 5 tokens
"At this point in time" "Now" 4 tokens
"Due to the fact that" "Because" 4 tokens
"In the event that" "If" 3 tokens
"For the purpose of" "To" / "For" 3 tokens
"A large number of" "Many" 3 tokens
"In close proximity to" "Near" 3 tokens

Consolidate Similar Sections

Before: Three identical prerequisite sections (Windows/macOS/Linux)

After:

## Prerequisites (All Platforms)
- Node.js 18+
- Azure CLI

Platform-specific: [references/INSTALL.md](references/INSTALL.md)

Savings: 50+ tokens

Formatting Optimization

Tables vs Lists

Before (verbose list):

- **Storage Account**: Minimum 3 characters, maximum 24 characters, 
  only lowercase letters and numbers allowed, must be globally unique.
- **Key Vault**: Minimum 3 characters, maximum 24 characters,
  alphanumerics and hyphens allowed, must be globally unique.

After (compact table):

| Resource | Min | Max | Allowed | Global |
|----------|-----|-----|---------|--------|
| Storage | 3 | 24 | a-z, 0-9 | Yes |
| Key Vault | 3 | 24 | a-z, 0-9, - | Yes |

Savings: ~30 tokens per 5 items

Inline Code vs Code Blocks

Before:

To list resources, run:

\`\`\`bash
az resource list --resource-group mygroup
\`\`\`

After:

List resources: `az resource list -g mygroup`

Savings: ~10 tokens per instance

Structural Patterns

Progressive Disclosure Structure

SKILL.md (< 500 tokens)
├── Overview (what + when)
├── Quick workflow (numbered steps)
├── Key commands/tools table
└── Links to references

references/
├── DETAILED-GUIDE.md (< 1000 tokens each)
├── TROUBLESHOOTING.md
└── EXAMPLES.md

Header Consolidation

Before:

## Overview
## Introduction  
## About This Skill
## What This Does

After:

## Overview

Savings: ~15 tokens per removed header + content

Source: SKILL.md on GitHub

No alerts15d5 checks · Risk SAFE
  • Gen Agent Trust Hub15d

    This skill is a markdown optimization utility focused on providing guidance for reducing token consumption in documentation. It consists entirely of informational markdown files and does not contain any executable code or security risks.

  • Socket15d

    No alerts

  • Snyk15d

    Risk: LOW · No issues

  • Runlayer7mo

    3 files scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 5829570. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 7 months ago
metadata
{
  "author": "Microsoft",
  "version": "1.0.0"
}
  • Documentation
  • markdown
  • tokens
  • optimization
  • file-size
  • ai-efficiency
  • conciseness
  • skill-md

README badge

README badge for microsoft/github-copilot-for-azure/markdown-token-optimizer

Analyzes markdown files for token efficiency and suggests optimizations to reduce consumption without sacrificing clarity. Counts tokens, identifies patterns like verbosity and duplication, and recommends fixes with estimated savings. Targets documentation and SKILL.md files that need to be more concise for AI consumption.

Generated from the current SKILL.md.

Does this skill modify files automatically?
No. It analyzes markdown and suggests optimizations in a table format but does not auto-modify files.
What token counting method does this use?
The skill uses an approximate rule of 4 characters equals 1 token.
What types of markdown problems does it detect?
It scans for emojis, verbosity, duplication, and large code blocks as token-wasting patterns.
What are the target file sizes this skill aims for?
SKILL.md files should be under 500 tokens, and reference files under 1000 tokens.

Generated from the current SKILL.md. These answers refresh after source changes.