promptcmd/lib

Library of examples and prompts ready to use

readforme.md
Extract information from the README.md of a given repository name
---
input:
  schema:
    repo: string, The github repository name
    info(enum, Which info is needed): [summary, installation, example, quickstart]
    branch?: string, Branch name, defaults to "main">
---
You are a github README assistant. Your task is to extract the requested
information from a given README content and summarize it in an accessible way,
straight to the point, with no noise.

If the requested information is not explicitly written in the readme, just
indicate that the information is not available. do not improvise, guess, or
assume.

## Requested Information

{{#if (eq "summary" info) }}
Give me a super brief summary of what this repo is about.
{{else if (eq "installation" info) }}
Give me direct installation instructions, nothing else.
{{else if (eq "example" info) }}
Give me a usage example, do not explain.
{{else if (eq "quickstart" info) }}
Give a quick start guide, if available.
{{/if}}

Here is the README:

{{# if branch }}
{{exec "curl" "-LsSf" (concat "https://raw.githubusercontent.com/" repo  "/refs/heads/" branch "/README.md")}}
{{ else }}
{{exec "curl" "-LsSf" (concat "https://raw.githubusercontent.com/" repo  "/refs/heads/main/README.md")}}
{{/if}
Download
render-md
Render markdown content with different styles
---
input:
  schema:
    style(enum)?: [minimal, github, blog, dark]
output:
  format: text
---
You are an expert web developer specializing in creating beautiful, readable
HTML pages from Markdown content.

# Task
Convert the provided Markdown content into a complete, standalone HTML page
with embedded CSS styling.

# Style Requirements

{{#if (eq style "github")}}

GitHub-inspired with blue link colors (#0969da), light gray backgrounds for
code blocks (#f6f8fa), bordered tables with zebra striping, system fonts,
inline code with pink/red tint (#cf222e background), blockquotes with left blue
border, clean sans-serif headings, 16px base font size.

{{else if (eq style "blog")}}

Blog Style: Large serif headings (Georgia, Cambria, Times), sans-serif body
text (system fonts), generous line-height (1.75), content max-width 680px,
subtle drop cap for first paragraph, large opening paragraph font size, ample
paragraph spacing (1.5em), pull quotes with larger italic text, minimal chrome,
focus on reading experience.

{{else if (eq style "dark")}}

Dark theme with #1a1a1a or #0d1117 background, #e6edf3 or #e0e0e0 text, #2d2d2d
or #161b22 code blocks, cyan/blue accent colors (#58a6ff), reduced contrast for
comfort, subtle shadows, muted syntax highlighting for code, darker borders
(#30363d), comfortable for night reading.

{{else}}

Minimalist with ample whitespace, system fonts (system-ui, -apple-system,
sans-serif), neutral color palette (blacks, grays, single accent color),
centered content with max-width 800px, generous margins and padding, subtle
borders, no shadows or gradients, focus on typography and spacing.

{{/if}}

# General Requirements
- Create a complete HTML5 document with proper DOCTYPE and meta tags
- Embed all CSS in a <style> tag (no external stylesheets)
- Ensure responsive design that works on mobile and desktop
- Use semantic HTML elements
- Include proper heading hierarchy
- Style code blocks with syntax highlighting colors
- Make links visually distinct and tables easy to read
- Ensure sufficient contrast for accessibility
- Add appropriate spacing and typography for readability

# Output
Provide only the complete HTML code, ready to save as an .html file.

# Markdown Content

{{STDIN}}
Download
translate
Translate text
---
input:
  schema:
    lang: string, Target language
    source-lang?: string, Source language, leave blank to auto detect
    text?: string, Text to translate, defaults to stdin
    summarize?: boolean, Whether to also summarize the text
---
{{#if source-lang}}
  Translate the given text from {{source-lang}} to {{lang}}
{{else}}
  Translate the given text to {{lang}}
{{/if}}

{{#if summarize}}
  Produce a summarized version of the translation.
{{/if}}

Here is the text:

{{#if text}}
{{text}}
{{else}}
{{stdin}}
{{/if}}
Download
docker-inspect-logs
Analyze docker logs for a given container name and report problems
---
input:
  schema:
    container: string, container name
---
Analyze the following logs and let me know if there are any problems:
{{exec "docker" "logs" container}}
Download
logs-aggregator
Aggregate log reports from nested prompts
---
---

You will be given log summaries of several docker containers. Your task is to
summarize their findings in a short markdown report, grouped by container as a
section.

At the end of the report, make sure to highlight any problems, recommendations,
or actions to take.

## Postgres:
{{prompt "docker-inspect-logs" container="postgres"}}

## Nginx
{{prompt "docker-logs-analyzer" container="nginx"}}

## Redis
{{prompt "docker-logs-analyzer" container="redis"}}
Download
nginx-report
Analyze nginx access logs to generate a structured markdown report
---
---

Analyze the following nginx access logs and create a comprehensive markdown report with these sections:

## Executive Summary
Provide a brief overview of the log period, total requests, and key findings.

## Traffic Overview
- Total number of requests
- Unique IP addresses
- Date/time range covered
- Requests per hour/day trend

## Top Resources
- Most frequently accessed URLs (top 10-20)
- Most bandwidth-intensive resources
- Static vs dynamic content breakdown

## HTTP Status Codes
- Distribution of status codes (200, 404, 500, etc.)
- List notable error patterns with specific URLs
- Success rate percentage

## Geographic & Client Analysis
- Top referrers (if available in logs)
- User agent breakdown (browsers, bots, mobile vs desktop)
- Identify bot traffic vs human traffic

## Security Concerns
- Suspicious access patterns (rapid requests from single IPs)
- Common attack vectors (SQL injection attempts, path traversal, etc.)
- 4xx/5xx errors that might indicate probing
- Unusual user agents

## Performance Insights
- Response time analysis (if available)
- Peak traffic periods
- Slowest endpoints

## Recommendations
Based on the analysis, suggest:
- Caching opportunities
- Security improvements needed
- Performance optimization targets

Format all tables clearly, use code blocks for sample log entries, and highlight critical issues in **bold**.

Here are the logs:

{{STDIN}}

Download
commitmsg
Generate commit messages from git diffs in conventional or simple format
---
# Usage Examples:
#
# Review the generated commit message before commiting:
# git diff --staged | commitmsg --style conventional | git commit -e --file -
#
# Or commit right away:
# git diff --staged | commitmsg --style conventional | git commit --file -
#
# Add alias for shorthand invocation:
# alias gc="git diff --staged | commitmsg --style conventional | git commit -e --file -"
input:
 schema:
   style: string, [conventional | simple]
output:
  format: text
---
Generate a commit message for the following git diff.

Style: {{style}}
{{#if (eq style "conventional")}}
Use the Conventional Commits format: type(scope): description

Types: feat, fix, docs, style, refactor, test, chore
{{else}}
Write a simple, clear commit message in plain English. One line, under 72 characters.
{{/if}}

Your output will be used directly as the commit message, so you must produce the
commit message without any formatting syntax like markdown and so on.

Diff:

{{STDIN}}
Download
rust-coder
Fix problems in rust code
---
---
You are a Rust code fixer. Given Rust code with errors:

1. Output only valid, compilable Rust code that fixes all issues
2. Preserve the original logic and intent
3. Fix compilation errors, unsafe patterns, and logic bugs
4. Follow Rust best practices (ownership, borrowing, error handling)

Output ONLY the corrected code with no explanations or markdown - it must be
directly usable as a replacement.

Here is the code:

{{STDIN}}
Download
sqlhelper
SQL query assistant and helper
---
# Example:
# sqlite3 ~/database.db .schema | sql-helper --question "Aggregate based on equal model name"
###################
input:
  schema:
    question: string
    explain: boolean
output:
  format: text
---
You are an expert SQL query generator. You will be provided with a database
schema and questions about the data. Your task is to generate accurate,
efficient SQL queries that answer the questions.

# Schema
{{STDIN}}

# Instructions
- Generate only valid SQL queries as responses
- Use proper SQL syntax and formatting
- Include comments only if the query logic is complex
- Optimize for readability and performance
- Use appropriate JOINs, WHERE clauses, and aggregations
- Handle NULL values appropriately
- If a question is ambiguous, make reasonable assumptions and state them
briefly

# Question
{{question}}

# Response Format
{{#if (eq explain "true")}}
Provide the SQL query and explain it.
{{else}}
Provide only the SQL query without additional explanation.
{{/if}}
Download
what
Explain command errors and suggest solutions
---
# Usage
#
# alias what='$(fc -ln -1) 2>&1 | promptctl run what'
#
# Whenever a program/command fails, run `what` to get
# explanation and suggestions.
output:
  format: text
---
Analyze this error and suggest fixes briefly:

{{STDIN}}

Provide: 1) What's wrong, 2) How to fix it. Keep it under 100 words.
Download
How
Ask "how" questions and get brief, straight-to-the-point answers from AI
---
input:
  schema:
    question!: string, A question to ask
output:
  format: text {{hello}}
---
Following is a question from the user. Be brief, and straight to the point:
How {{question}}?
Download