Skip to content

adisingh-cs/Marlin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marlin

Marlin

Swift input. Sharp output. Every token counts.

InstallModesUsageV3 DSLRoadmapContributing

version license platforms


Marlin compresses what you send to the model — not what the model says back. It restructures verbose prompts into lean, schema-anchored representations. The model receives a cleaner, denser signal and returns sharper, more deterministic output.

Input tokens cost money. Verbose prompts waste context window. Marlin fixes the input side.


Install

One-liner (recommended — auto-detects your agents)

macOS / Linux / WSL / Git Bash:

curl -fsSL https://raw.githubusercontent.com/adisingh-cs/Marlin/main/install.sh | bash

Windows (PowerShell):

irm https://raw.githubusercontent.com/adisingh-cs/Marlin/main/install.ps1 | iex

Detects Claude Code, Gemini CLI, Cursor, Windsurf, Cline, Copilot, Codex, Antigravity, opencode, Roo, Kiro, and more. Runs each one's native install. Skips what you don't have. Safe to re-run.

bash install.sh --all      # also drop always-on rule files into current repo
bash install.sh --minimal  # skill only, no extras
bash install.sh --list     # show all supported agent slugs

Install by agent

Agent Command
Claude Code npx skills add adisingh-cs/Marlin -g -a claude-code
Gemini CLI gemini extensions install https://github.com/adisingh-cs/Marlin
Cursor npx skills add adisingh-cs/Marlin -g -a cursor
Windsurf npx skills add adisingh-cs/Marlin -g -a windsurf
Cline npx skills add adisingh-cs/Marlin -g -a cline
GitHub Copilot npx skills add adisingh-cs/Marlin -g -a github-copilot
Codex npx skills add adisingh-cs/Marlin -g -a codex
Antigravity npx skills add adisingh-cs/Marlin -g -a antigravity
opencode npx skills add adisingh-cs/Marlin -g -a opencode
All agents npx skills add adisingh-cs/Marlin -g

Claude.ai (chat interface)

  1. Download ZIP from github.com/adisingh-cs/Marlin
  2. Go to claude.ai/customize/skills
  3. Click + → upload SKILL.md from the ZIP
  4. Done — use /marlin swift, /marlin sharp, /marlin strike, /marlin sonar

Uninstall

npx skills remove marlin
# or
gemini extensions uninstall marlin

Modes

Four modes. One command prefix. You pick the intensity.

Command Intensity Target Reduction Best For
/marlin swift Light ~20–35% General prompts, first use
/marlin sharp Mid ~35–50% API calls, repeated workflows
/marlin strike Max ~50–70% High-volume, cost-sensitive
/marlin sonar Domain ~40–65% Web-API, data, agent tasks

Usage

/marlin swift — normalize and structure

/marlin swift

I want to build a login endpoint that takes email and password,
checks against the database, and returns a JWT token if valid.
Only use PostgreSQL. Output as JSON.

Output:

{
  "goal": "build login endpoint",
  "action": "create",
  "inputs": ["email", "password"],
  "domain": "authentication",
  "constraints": ["PostgreSQL only"],
  "format": "json"
}

Original: ~38 tokens → Compressed: ~28 tokens → Saved: ~26%


/marlin sharp — compact JSON, short keys

/marlin sharp

I want to build a login endpoint that takes email and password,
checks against the database, and returns a JWT token if valid.
Only use PostgreSQL. Output as JSON.

Output:

{"g":"build login endpoint","a":"create","i":["email","password"],"d":"authentication","c":["PostgreSQL only"],"f":"json"}

Original: ~38 tokens → Compressed: ~22 tokens → Saved: ~42%


/marlin strike — maximum compression

/marlin strike

I want to build a login endpoint that takes email and password,
checks against the database, and returns a JWT token if valid.
Only use PostgreSQL. Output as JSON.

Output:

{"g":"build login ep","a":"create","i":"email,password","d":"auth","c":"PostgreSQL only","f":"json"}

Original: ~38 tokens → Compressed: ~18 tokens → Saved: ~53%


/marlin sonar — domain-aware compression

/marlin sonar --schema web-api

Create a POST endpoint at /api/users/login that accepts email and
password in the request body, validates with JWT, returns tokens.
Requires Authorization header. Version 2.

Output:

{"m":"POST","ep":"/api/users/login","au":"jwt","pl":["email","password"],"hd":["Authorization"],"rf":"json","v":"2"}

Original: ~42 tokens → Compressed: ~21 tokens → Saved: ~50%

Available schemas: --schema web-api · --schema data-pipeline · --schema agent-task


Output Flags

Append to any command:

Flag Returns
--prompt Compressed prompt only — ready to paste
--report Compressed + token savings report (default)
--diff Original vs compressed side by side
--all Everything

Example: /marlin sharp --diff


V3 DSL

For agent-to-agent passing and ultra-compact storage:

# Internal DSL (store/pass between agents)
G:build login ep|A:create|I:email,password|D:auth|F:json

# Bridge to JSON before sending to any LLM
/marlin bridge G:build login ep|A:create|I:email,password|D:auth|F:json

Append --dsl to any mode command for DSL output.


Quick Reference

/marlin swift          Normalize + structure  (target: ~20–35%)
/marlin sharp          Compact + short keys   (target: ~35–50%)
/marlin strike         Maximum compression    (target: ~50–70%)
/marlin sonar          Domain schema          (target: ~40–65%)

--prompt   Compressed prompt only
--report   Prompt + savings report (default)
--diff     Side-by-side comparison
--all      Everything
--dsl      V3 internal DSL format

Works great with caveman

Marlin compresses input. caveman compresses output. Run both — save on both ends.


Benchmarks

🚧 Benchmark results pending. Run it yourself with OpenRouter: python benchmarks/run.py --api-key "sk-or-..." --model "openai/gpt-4o-mini"

You can also set OPENROUTER_API_KEY and OPENROUTER_MODEL. The harness records heuristic token savings plus compression-system overhead.


Roadmap

  • V1 (now): Single SKILL.md, four modes, npx install, V3 DSL
  • V2: npm package + REST API — deterministic compression, no LLM needed
  • V3: Multi-agent pipeline support, domain schema expansion

Full roadmap →


Contributing

Contributions welcome — new domain schemas, key maps, examples, benchmark results. Read CONTRIBUTING.md first.


Attribution

MIT License. Free to use, fork, and build on. If Marlin saves you tokens, a ⭐ or a mention helps others find it. ATTRIBUTION.md


Built by @adisingh-cs — Aditya Singh

About

AI-native input prompt optimizer. Compress and restructure prompts into lean schema-anchored representations.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors