Install
$ agentstack add skill-josephsanjaya-skills-optimize-prompt ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Optimize Prompt & Review Skill
This skill provides workflow guidance and automated tooling to audit, analyze, compress, and optimize LLM prompts, instructions, and Claude Code environments for maximum token efficiency and reasoning accuracy.
Delineate prompts with XML tags, enforce append-only prefix caching alignment, select iterative effort levels, utilize symbolic abbreviations/protocols, and implement Prism Prompting constraints.
1. Quick Decision Tree
What do you need?
├── Fix a bug → Bug Triage Protocol (references/prompt-framework.md)
├── Add a feature → Incremental First-Step pattern (references/examples.md)
├── Explore large codebase → Subagent delegation (references/subagents-and-scaling.md)
├── Session is getting slow/expensive → Context hygiene (references/context-management.md)
├── Agent ignoring instructions → Context decay recovery (references/edge-cases.md)
├── Run Heuristic Auditor → Run python tool (scripts/audit_prompt.py)
├── Analyze Token Usage → Run python tool (scripts/analyze_token_usage.py)
└── Compress Prompt/Code → Run python tool (scripts/compress_prompt.py)
2. Quick Start Workflow
To analyze and optimize a prompt:
- Run Automated Heuristic Audit:
Execute the Python auditor on the prompt string, stdin, or file: ``bash python scripts/audit_prompt.py `` For SKILL.md files, the auditor validates:
- Frontmatter presence and structure (required
---markers) - Required fields:
nameanddescription - Proper YAML syntax (unquoted colons in values will trigger a failure)
- Name format (lowercase kebab-case)
- Analyze Token/Session Cost:
Analyze token distribution of files or conversation history files (.json): ``bash python scripts/analyze_token_usage.py ``
- Compress Prompt / Apply Shorthand:
Compress prompt text by removing filler words, pleasantries (Caveman Mode), and optionally applying symbolic Less-Token-Language (LTL): ``bash python scripts/compress_prompt.py --symbolic --caveman ``
- Apply Automated Corrections:
Use the --fix parameter to programmatically clean up politeness, persona placebo, and caching order: ``bash python scripts/audit_prompt.py --fix ``
- Validate Bounded Context:
Ensure the prompt uses @file:line for targeting and !command for diagnostic output instead of prose.
3. Reference Documentation Index
For details on API configurations, token economics, and LLM constraints, read these references:
- [knowledge.md](file:///Users/jsanjaya/Projects/skills/optimize-prompt/references/knowledge.md): Attention dilution, lost-in-the-middle positioning bias, prefix caching, and tokenization fertility.
- [examples.md](file:///Users/jsanjaya/Projects/skills/optimize-prompt/references/examples.md): Copy-pasteable good/bad prompt layouts, Outlines CFGs, Pydantic AI models, Zod schemas, and vLLM/LMCache configurations.
- [prompt-framework.md](file:///Users/jsanjaya/Projects/skills/optimize-prompt/references/prompt-framework.md): Five-pillar templates, bug triage protocols, XML tags, effort levels, context operators, and CLAUDE.md/MCP/commands structures.
- [context-management.md](file:///Users/jsanjaya/Projects/skills/optimize-prompt/references/context-management.md): Token budgets, slash commands (
/clear,/compact), CLAUDE.md size rules, compaction, and session reset guidelines. - [subagents-and-scaling.md](file:///Users/jsanjaya/Projects/skills/optimize-prompt/references/subagents-and-scaling.md): Subagent delegation config, horizontal project scaling, and MCP vs CLI token cost benchmarks.
- [edge-cases.md](file:///Users/jsanjaya/Projects/skills/optimize-prompt/references/edge-cases.md): Context decay symptoms, lossy compaction, and sync conflicts.
- [symbolic-languages.md](file:///Users/jsanjaya/Projects/skills/optimize-prompt/references/symbolic-languages.md): Mathematical operators, LTL (Less-Token-Language), Hieratic shorthand, Caveman protocol, and Wenyan-lang mode.
- [algorithmic-compression.md](file:///Users/jsanjaya/Projects/skills/optimize-prompt/references/algorithmic-compression.md): Secondary model prompt compression (LLMLingua), Dynamic Memory Sparsification (DMS), and AST-aware Claw Compactor.
- [architectural-patterns.md](file:///Users/jsanjaya/Projects/skills/optimize-prompt/references/architectural-patterns.md): Core architectural patterns for token efficiency including AtomicRAG, Spine Architecture, Subagent Forking, and Modular Context Loading.
- [data-formats.md](file:///Users/jsanjaya/Projects/skills/optimize-prompt/references/data-formats.md): Token density comparison across Markdown, YAML, JSON, XML, and TOON (Token-Oriented Object Notation).
- [caching-strategies.md](file:///Users/jsanjaya/Projects/skills/optimize-prompt/references/caching-strategies.md): Ephemeral prefix caching, semantic caching with embeddings, VectorQ adaptive thresholds, and hybrid multi-layer caching.
Developers must use this schema to verify cache alignments and format outputs before execution.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: JosephSanjaya
- Source: JosephSanjaya/skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.