Agent skill

Prompt Library Minimal

คลัง prompts แบบ minimal ที่ใช้ token น้อยที่สุดแต่ได้ผลลัพธ์ดี พร้อม templates และ best practices

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/prompt-library-minimal

SKILL.md

Prompt Library Minimal

Overview

คลัง prompts ที่ optimize แล้วให้ใช้ token น้อยที่สุด แต่ยังคงประสิทธิภาพ - เหมาะสำหรับ production ที่ต้องการลด cost

Why This Matters

  • Cost savings: ลด token usage 50-70%
  • Speed: น้อย token = response เร็วขึ้น
  • Proven: Tested และใช้งานจริง
  • Reusable: Copy-paste ได้เลย

Code Review

Verbose (❌ 85 tokens)

I would like you to please review this code carefully and provide 
detailed feedback on potential bugs, performance issues, security 
vulnerabilities, and code quality concerns. Please also suggest 
improvements and best practices that could be applied.

Minimal (✅ 12 tokens)

Review for bugs, performance, security. Suggest improvements.

Savings: 86%


Bug Fix

Verbose (❌ 120 tokens)

I'm experiencing an issue where the login function is not working 
properly. When users try to log in, they receive an error message. 
Could you please help me identify what might be causing this problem 
and suggest a solution? Here is the relevant code...

Minimal (✅ 18 tokens)

Login fails with error. Fix:
[code]

Expected: successful login
Actual: error message

Savings: 85%


Code Generation

Verbose (❌ 95 tokens)

Please write a function that will calculate the sum of two numbers. 
The function should accept two parameters and return their sum. 
Please include proper error handling and add comments explaining 
what the code does.

Minimal (✅ 15 tokens)

Function: sum two numbers
Include: error handling, comments
Language: TypeScript

Savings: 84%


Refactoring

Verbose (❌ 110 tokens)

I have this code that works but I think it could be improved. 
Could you please refactor it to make it more readable, maintainable, 
and efficient? Please follow best practices and modern coding standards. 
Also, please explain the changes you make.

Minimal (✅ 8 tokens)

Refactor for readability, efficiency:
[code]

Savings: 93%


Documentation

Verbose (❌ 75 tokens)

Please write comprehensive documentation for this function including 
a description of what it does, the parameters it accepts, what it 
returns, and provide usage examples.

Minimal (✅ 6 tokens)

Document function:
[code]

Savings: 92%


Testing

Verbose (❌ 90 tokens)

I need you to write unit tests for this function. The tests should 
cover normal cases, edge cases, and error cases. Please use Jest 
as the testing framework and follow testing best practices.

Minimal (✅ 10 tokens)

Jest tests (normal, edge, error):
[code]

Savings: 89%


Debugging

Verbose (❌ 100 tokens)

I'm getting an error in my code and I can't figure out what's wrong. 
The error message says "Cannot read property 'name' of undefined". 
Can you help me understand what's causing this and how to fix it?

Minimal (✅ 12 tokens)

Error: Cannot read property 'name' of undefined
Code: [snippet]
Fix?

Savings: 88%


Optimization

Verbose (❌ 85 tokens)

This code is running slowly and I need to optimize it for better 
performance. Can you analyze it and suggest ways to make it faster? 
Please focus on algorithmic improvements and best practices.

Minimal (✅ 8 tokens)

Optimize for speed:
[code]

Savings: 91%


Template Library

Code Review Template

Review for [aspects]:
[code]

Bug Fix Template

[Issue] fails with [error]
Code: [snippet]
Expected: [behavior]
Actual: [behavior]

Feature Request Template

Add [feature]:
- Input: [description]
- Output: [description]
- Edge cases: [list]

Refactor Template

Refactor for [goals]:
[code]

Test Template

[Framework] tests ([cases]):
[code]

Output Format Specifications

JSON Output

Output JSON:
{
  "field1": "...",
  "field2": "..."
}

List Output

List 5 items:
1. ...

Code Only

Code only, no explanation:
[requirements]

Summary

Summary (≤50 words):
[content]

Constraints

Length Constraints

Max 100 words
Max 10 lines
≤3 bullet points

Format Constraints

TypeScript only
No comments
Use async/await

Style Constraints

Functional style
No loops (use map/filter)
Immutable

Best Practices

1. Use Imperative Mood

❌ "Could you please write..."
✅ "Write..."

❌ "I would like you to..."
✅ "Create..."

2. Specify Output Format

❌ "Explain this code"
✅ "Explain in 3 bullet points"

3. Be Specific

❌ "Make it better"
✅ "Optimize for speed"

4. Remove Pleasantries

❌ "Thank you for your help"
✅ [omit]

❌ "Please and thank you"
✅ [omit]

5. Use Abbreviations

❌ "TypeScript"
✅ "TS"

❌ "JavaScript"
✅ "JS"

❌ "database"
✅ "DB"

Quick Reference

Common Tasks

Task Minimal Prompt Tokens
Code review Review for bugs, performance: 4
Bug fix Fix: [error] 2
Generate Function: [description] 2
Refactor Refactor for [goal]: 3
Test Tests ([cases]): 2
Document Document: 1
Optimize Optimize for [metric]: 3
Debug Error: [message]. Fix? 3

Measurement

Before Optimization

Average prompt: 95 tokens
Cost per 1000 requests: $4.75

After Optimization

Average prompt: 15 tokens
Cost per 1000 requests: $0.75
Savings: 84%

Summary

Prompt Library Minimal: Prompts ที่ใช้ token น้อยที่สุด

Savings:

  • Code review: 86%
  • Bug fix: 85%
  • Generation: 84%
  • Refactoring: 93%
  • Documentation: 92%

Principles:

  • Imperative mood
  • No pleasantries
  • Specify format
  • Be specific
  • Use abbreviations

Average savings: 85-90%

Usage:

Copy template → Fill in details → Use

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results