Shortcut: rm:opt. Transforms markdown into AI agent-optimized format. Use ONLY when explicitly asked to 'optimize for agents', 'make agent-friendly', 'compress for AI agents', or 'transform to agent format'. Only processes .md/.mdc files.
Transforms markdown instruction files into formats optimized for AI coding agents/agents.
Check if file has .md or .mdc extension.
Use the opencode question tool to ask:
{
"questions": [
{
"question": "This skill transforms markdown into AI agent-optimized format (concise, imperative, token-efficient, human-unreadable). Is [filename] an agent-only instruction file meant for AI agents, not humans?",
"options": [
{
"label": "Yes",
"description": "File is agent-only, proceed with optimization"
},
{
"label": "No",
"description": "File is for humans, cancel the operation"
}
],
"header": "Confirm File Type"
}
]
}
Read the entire file and categorize content:
Check for agent-optimized indicators:
Identify optimization opportunities:
Detect partial optimization:
If file is already fully optimized: Output compact status (1-4 lines):
FILE STATUS: Already agent-optimized
- Structure: [CRITICAL/COMMANDS/BOUNDARIES present]
- Compression: [High - tables used, prose minimal]
- Action: No transformation needed
If file can be improved: Proceed to transformation preserving ALL information.
Apply these rules preserving every piece of information:
Information Preservation: Every constraint, command, version, path, example MUST be preserved. Nothing lost, only reformatted.
Priority Order (Most Important First):
Compression Techniques:
Three-Tier Boundaries Format:
ALWAYS:
- [action with verification if applicable]
ASK FIRST:
- [action]: [condition requiring approval]
NEVER:
- [action] - [reason]
Command Format:
COMMANDS:
| Command | Purpose | When |
|---------|---------|------|
| `cmd` | What it does | Trigger condition |
Output Template:
# [Type]: [Name]
## CRITICAL
[Hard constraints]
## COMMANDS
[Table]
## STACK
[Tech versions]
## STRUCTURE
[Paths with access]
## WORKFLOWS
[Step procedures]
## PATTERNS
[Code examples]
## BOUNDARIES
### ALWAYS
[List]
### ASK FIRST
[List]
### NEVER
[List]
## CONTEXT
[Remaining info]
Before outputting, confirm ALL information from input exists in output:
Write optimized content to file or present to user based on context.
Input (Partially optimized with new verbose section):
# AGENTS
## CRITICAL
- NEVER commit secrets
## COMMANDS
| Command | Purpose |
| -------------- | ------- |
| `dotnet build` | Build |
## New Section (verbose)
We recently added a requirement that you should please make sure to run the test suite before committing any changes. It's really important because tests catch bugs. You should use `dotnet test` and make sure all tests pass. This is a best practice that we follow.
Output:
# AGENTS: Project Guide
## CRITICAL
- NEVER commit secrets
- ALWAYS run `dotnet test` before commit
## COMMANDS
| Command | Purpose |
| -------------- | -------------- |
| `dotnet build` | Build project |
| `dotnet test` | Run test suite |
Input (Verbose, needs full optimization):
# Project Instructions
Welcome! This guide will help you work with our Blazor codebase.
## Getting Started
Please make sure you have .NET 9 SDK installed. You can check by running `dotnet --version`.
## Building
To build the project, you should run dotnet build. This is important because it compiles the C# code.
## Testing
We care about testing. Please run dotnet test before committing.
## Code Style
Use PascalCase for methods and types. Use camelCase for private fields. Also, please use file-scoped namespaces.
Output:
# AGENTS: Project
## CRITICAL
- ALWAYS run `dotnet test` before commit
- PascalCase methods/types, camelCase private fields
- Use file-scoped namespaces
## COMMANDS
| Command | Purpose |
| ------------------ | ------------------- |
| `dotnet --version` | Verify .NET version |
| `dotnet build` | Build project |
| `dotnet test` | Run test suite |
## STACK
- **.NET**: 9.0