ワンクリックで
tool-usage-guide
Guidance on when and how to use tools effectively. Use when the user asks about tools, API calls, or executing operations.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Guidance on when and how to use tools effectively. Use when the user asks about tools, API calls, or executing operations.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Design and build film-inspired visual work — websites AND PowerPoint presentations (.pptx). Use when the user asks for a cinematic site, movie-style landing page, director-inspired UI, film-noir, sci-fi, romance, thriller, action, animation, or a movie-like web aesthetic. Also use when the user asks to redesign a presentation, deck, or 簡報 with a cinematic or editorial visual system, or uses /cinematic-ui before any slide-related request. Trigger on cinematic site, cinematic deck, 電影感簡報, 重新設計簡報, editorial presentation, Wes Anderson slides, noir pptx, or any combination of film language with slides / deck / pptx / 簡報 / 投影片. Do not use for generic web design or generic slide design unless the user explicitly wants a film or director reference.
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
Python programming tutorial and best practices. Use when the user asks about Python basics, syntax, or wants to learn Python programming.
Provides systematic code review guidance. Use when the user asks to review code, check code quality, find bugs, or improve code structure.
Systematic debugging guidance for finding and fixing code issues. Use when the user reports a bug, error, unexpected behavior, or asks for help troubleshooting.
| name | tool-usage-guide |
| description | Guidance on when and how to use tools effectively. Use when the user asks about tools, API calls, or executing operations. |
This skill provides best practices for using tools effectively in AI agent systems.
Tools should be used when you need to:
For File Operations:
# Reading
read_file(path) # Read entire file
read_file_lines(path, start, end) # Read specific lines
# Writing
write_file(path, content) # Write/overwrite
append_file(path, content) # Append
For Web Operations:
search_web(query) # Search engines
fetch_url(url) # Get webpage content
api_call(endpoint, data) # API requests
For Data Operations:
parse_json(text) # JSON parsing
parse_csv(text) # CSV parsing
calculate(expression) # Math calculations
Always verify:
Example:
# ❌ Bad: Direct operation
content = read_file(path)
# ✅ Good: Check first
if file_exists(path):
content = read_file(path)
else:
# Handle missing file
Anticipate failures:
Example:
# Try the operation
result = api_call(endpoint)
# If it fails, have a fallback
if result.error:
# Use cached data or default value
result = get_cached_data()
Why:
Strategies:
# ❌ Bad: Multiple calls for same data
data1 = read_file("config.json")
data2 = read_file("config.json") # Duplicate!
# ✅ Good: Call once, reuse
data = read_file("config.json")
# Use 'data' multiple times
Before calling tools:
# ❌ Bad: No validation
write_file(user_path, user_content)
# ✅ Good: Validate first
if is_safe_path(user_path):
if is_valid_content(user_content):
write_file(user_path, user_content)
Match tool to task:
# ❌ Bad: Wrong tool
execute_bash("cat file.txt") # Overkill
# ✅ Good: Right tool
read_file("file.txt") # Direct and safe
# 1. Read input
data = read_file("input.txt")
# 2. Process (this is where you apply logic)
processed = transform(data)
# 3. Write output
write_file("output.txt", processed)
# 1. Try primary source
result = api_call(primary_endpoint)
# 2. Fallback if needed
if not result:
result = api_call(backup_endpoint)
# 3. Ultimate fallback
if not result:
result = use_default_data()
# ❌ Bad: One at a time
for item in items:
process(item) # N tool calls
# ✅ Good: Batch when possible
process_batch(items) # 1 tool call
# ❌ Dangerous
read_file(user_input) # Could be "../../etc/passwd"
# ✅ Safe
safe_path = sanitize_path(user_input)
if is_within_allowed_dir(safe_path):
read_file(safe_path)
# ❌ Dangerous
execute_code(user_input) # Could be malicious
# ✅ Safe
if is_safe_code(user_input):
execute_in_sandbox(user_input)
# ❌ Bad: Exposed key
api_call(url, api_key="sk_live_...")
# ✅ Good: Use environment variables
api_call(url, api_key=get_env_var("API_KEY"))
# Cache expensive operations
@cache
def get_heavy_data():
return api_call(expensive_endpoint)
# Subsequent calls use cache
# ❌ Sequential: Slow
data1 = fetch_url(url1)
data2 = fetch_url(url2)
# ✅ Parallel: Fast
data1, data2 = parallel_fetch([url1, url2])
# Don't load until needed
def process():
# Only load if condition met
if needs_data:
data = read_large_file()
Provide helpful errors:
# ❌ Bad
"Error"
# ✅ Good
"Failed to read 'config.json': File not found.
Please check the file path is correct."
Combine tools effectively:
# Example: Complete workflow
def analyze_data(filename):
# 1. Read
raw_data = read_file(filename)
# 2. Parse
data = parse_json(raw_data)
# 3. Calculate
stats = calculate_stats(data)
# 4. Format
report = format_report(stats)
# 5. Write
write_file("report.txt", report)
When tools fail:
Example:
result = read_file(path)
if result.error:
print(f"Error: {result.error}")
print(f"Path tried: {path}")
print(f"Does file exist: {file_exists(path)}")
Remember:
Tools are powerful but should be used thoughtfully and safely!