By *[Your Name]** ā Tech Writer & PromptāEngineering Enthusiast*
Tags: prompt-engineering stripe discord-bot reddit-api
TL;DR
- Generate a 2āpage, 20āitem checklist with an LLM (GROQ/OpenRouter).
- Save it as a PDF on your VPS.
- Create a $5 Stripe product called āAI Prompt Checklistā and grab a oneātime Checkout URL.
- Craft a short, punchy promotional blurb for each community.
- Post it automatically to three Discord servers and two Reddit subāreddits.
- Log every URL and message for future analytics.
Below is a complete, readyātoārun Python script (with comments) that ties all of those steps together. You can copyāpaste, fill in your own secrets, and watch the automation run.
ā” Pro tip: If youāre selling the checklist on a small scale, Stripeās Checkout is the fastest way to collect payment without building a full eācommerce stack.
1ļøā£ PromptāEngineering BestāPractice Checklist (PDF Content)
| # | Best Practice | Why It Matters |
|---|---|---|
| 1 | Define the Goal First ā Write a oneāsentence problem statement. | Keeps the prompt focused. |
| 2 | Use Explicit Instructions ā āList three ā¦ā instead of āGive me ā¦ā. | Reduces ambiguity. |
| 3 | Leverage System Prompts ā Set tone, role, or persona at the top. | Guides LLM behavior. |
| 4 | Show, Donāt Tell ā Provide examples of desired output. | Improves consistency. |
| 5 | Limit Token Length ā Keep prompts <āÆ150 tokens when possible. | Saves cost & latency. |
| 6 | ChaināofāThought ā Ask the model to āthink stepābyāstepā. | Boosts reasoning accuracy. |
| 7 | Use Temperature Wisely ā Low (0.2ā0.4) for factual, high (0.7ā1.0) for creativity. | Controls randomness. |
| 8 | Specify Output Format ā JSON, CSV, Markdown, etc. | Easier downstream parsing. |
| 9 | Avoid Leading Questions ā Neutral phrasing prevents bias. | Improves fairness. |
| 10 | Iterative Refinement ā Run a short ādebugā prompt to tweak. | Faster convergence. |
| 11 | Guardrails & Safety ā Add āavoid profanityā or āno political contentā. | Prevents policy violations. |
| 12 | Use RetrievalāAugmented Generation ā Pull relevant docs first. | Improves factuality. |
| 13 | Batch Similar Queries ā One prompt for many items when possible. | Reduces API calls. |
| 14 | Cache Results ā Store deterministic responses for reuse. | Cuts cost. |
| 15 |
Version Your Prompts ā Tag with v1.0, v1.1, ⦠|
Enables A/B testing. |
| 16 | Document Edge Cases ā Note failures & workarounds. | Futureāproofs your workflow. |
| 17 | Mind the Context Window ā Summarize long histories. | Avoids truncation. |
| 18 | Test Across Models ā GPTā4, Claude, Llamaā3, etc. | Finds the best fit. |
| 19 | Measure Latency & Cost ā Log token usage per run. | Optimizes budget. |
| 20 | Stay Updated ā Follow model release notes & community forums. | Keeps you competitive. |
The PDF is generated programmatically in the script below (see SectionāÆ2).
2ļøā£ Full Automation Script (PythonāÆ3.10+)
ā ļø Disclaimer: Replace placeholder strings (
YOUR_ā¦) with your real API keys, Discord bot token, and Reddit credentials. Never commit secrets to a public repo.
python
#!/usr/bin/env python3
"""
AI Prompt Checklist ā Stripe product ā Discord + Reddit promotion
"""
import os
import json
import logging
from datetime import datetime
from pathlib import Path
import httpx
from weasyprint import HTML # pip install weasyprint
import stripe # pip install stripe
import discord # pip install discord.py
import praw # pip install praw
# -------------------------------------------------
# 1ļøā£ CONFIGURATION (fill these in!)
# -------------------------------------------------
# LLM (GROQ/OpenRouter) ā you can swap for OpenAI if you prefer
LLM_ENDPOINT = "https://api.groq.com/openai/v1/chat/completions"
LLM_API_KEY = os.getenv("GROQ_API_KEY") # set in your VPS env
# Stripe
stripe.api_key = os.getenv("STRIPE_SECRET_KEY")
# Discord
DISCORD_BOT_TOKEN = os.getenv("DISCORD_BOT_TOKEN")
DISCORD_CHANNEL_IDS = [
123456789012345678, # replace with actual channel IDs
234567890123456789,
345678901234567890,
]
# Reddit (PRAW)
REDDIT_CLIENT_ID = os.getenv("REDDIT_CLIENT_ID")
REDDIT_CLIENT_SECRET = os.getenv("REDDIT_CLIENT_SECRET")
REDDIT_USERNAME = os.getenv("REDDIT_USERNAME")
REDDIT_PASSWORD = os.getenv("REDDIT_PASSWORD")
REDDIT_USER_AGENT = "AI-Prompt-Checklist-Bot/0.1"
# -------------------------------------------------
# 2ļøā£ HELPER FUNCTIONS
# -------------------------------------------------
def generate_checklist():
"""Ask the LLM to produce the markdown checklist (20 items)."""
prompt = """You are a senior AI promptāengineering consultant.
Write a concise 2āpage markdown checklist containing exactly 20 bestāpractice items.
Each item must be a short title followed by a oneāsentence rationale.
Return ONLY the markdown (no extra explanation)."""
payload = {
"model": "mixtral-8x7b-32768", # example GROQ model
"messages": [{"role": "user", "content": prompt}],
"temperature": 0.2,
"max_tokens": 1500,
}
headers = {"Authorization": f"Bearer {LLM_API_KEY}"}
resp = httpx.post(LLM_ENDPOINT, json=payload, headers=headers, timeout=30)
resp.raise_for_status()
return resp.json()["choices"][0]["message"]["content"]
def markdown_to_pdf(md_text, output_path):
"""Convert markdown ā HTML ā PDF via WeasyPrint."""
# Simple conversion: wrap markdown in <pre> for quick demo.
html = f"<html><body><pre>{md_text}</pre></body></html>"
HTML(string=html).write_pdf(output_path)
def create_stripe_product():
"""Create a $5 oneātime product and return a Checkout URL."""
product = stripe.Product.create(name="AI Prompt Checklist")
price = stripe.Price.create(
product=product.id,
unit_amount=500, # cents ā $5.00
currency="usd",
)
session = stripe.checkout.Session.create(
payment_method_types=["card"],
line_items=[{"price": price.id, "quantity": 1}],
mode="payment",
success_url="https://yourdomain.com/success?session_id={CHECKOUT_SESSION_ID}",
cancel_url="https://yourdomain.com/cancel",
)
return session.url, product.id, price.id
def build_promotional_message
Top comments (0)