A good prompt isn't clever phrasing. It's a structured contract with the model. Learn the master template every prompt in the firm uses.
The Five Sections Every Production Prompt Has
Every prompt that drives production code in the DeadCatFound firm follows the same five-section structure. Skip a section and the model fills the gap with assumptions β and you debug those assumptions for hours.
Role β who the model is (e.g., "You are a quantitative analyst")
Context β the background it needs (universe, constraints, data shape)
Task β exactly what to do, in imperative voice
Output format β the exact schema you want back (JSON, line format, etc.)
Constraints β what NOT to do (no prose, no markdown, no caveats)
The Master Prompt Template
Copy this. Adapt it. Use it as the spine of every prompt you write:
π§¬master_template.txt
Foundation
ROLE:
You are a [job title] working for a [type of organization].
You have [N years] of experience in [specific domain].
CONTEXT:
- Today is [date]
- We are analyzing [specific universe / dataset]
- Constraints: [hard limits the model must respect]
- Data shape: [JSON keys, column names, units]
TASK:
[Imperative sentence describing the single action to take.]
[If multi-step, number the steps explicitly.]
OUTPUT FORMAT:
Return ONLY a JSON object with the following schema:
{
"field_name": <type>, // brief description
...
}
CONSTRAINTS:
- Do NOT include any prose or explanation
- Do NOT use markdown formatting
- Do NOT add caveats or disclaimers
- If you cannot complete the task, return: {"error": "<reason>"}
Why This Works
The model has been trained on millions of conversations where vague prompts produced vague answers. A strict 5-section structure tells it "we are operating in production mode" β and quality jumps measurably.
Track 02 β AI MasteryTX-02
Telegram Integration
Two prompts: one to generate the send_telegram() function, one to generate the command listener. Together they wire your firm to your phone.
The send_telegram() Function
This prompt produces a complete, copy-paste Python function that sends formatted alerts to a Telegram chat. Drop the output into scripts/telegram.py and you're done:
π±telegram_sender.txt
Code Gen
ROLE:
You are a senior Python developer building production alerting infrastructure.
CONTEXT:
- We need to send messages from a trading firm to a private Telegram chat
- Credentials are stored in config/notifications.json with keys:
telegram_token, telegram_chat_id
- The function will be called from many other scripts β must be robust
TASK:
Write a Python module scripts/telegram.py that exposes:
send_telegram(message: str, parse_mode: str = "HTML") -> bool
Requirements:
1. Load config from BASE/config/notifications.json (BASE = parent dir)
2. POST to api.telegram.org with 10s timeout
3. Retry once on network error
4. Return True on HTTP 200, False otherwise
5. Log failures (not successes) to logs/telegram.log
6. Support HTML formatting tags
OUTPUT FORMAT:
A single complete Python file, no commentary, no markdown fences.
Include all imports. Include a __main__ block that sends "test alert".
CONSTRAINTS:
- No external dependencies beyond requests + pathlib + json + logging
- No hardcoded credentials
The Command Listener
This prompt produces a long-polling listener that lets you control the firm from your phone β send /status and get back NAV, positions, and heartbeat:
ποΈtelegram_listener.txt
Code Gen
ROLE:
You are a senior Python developer.
CONTEXT:
- We need a Telegram bot that listens for commands and dispatches them
- It runs as a launchd job with KeepAlive=true (must crash-resist)
- Commands must come ONLY from telegram_chat_id in config
TASK:
Write scripts/telegram_listener.py that:
1. Long-polls api.telegram.org/getUpdates with 30s timeout
2. On each message, validates sender_id == telegram_chat_id
3. Routes commands:
/status -> reads dashboard/trades.json and replies with NAV + positions
/halt -> touches memory/HALT (executors check this flag)
/resume -> removes memory/HALT
/pnl -> computes daily P&L from trades.json
4. Logs every command + response to logs/telegram.log
5. Sleeps 1s and loops forever
OUTPUT FORMAT:
Single Python file. No commentary. No markdown fences.
CONSTRAINTS:
- Use only stdlib + requests
- Must survive network errors without crashing
Track 02 β AI MasteryTX-03
Email Integration
When Telegram fails, email is the fallback. This prompt produces a unified email sender that works with both Gmail and Yahoo via SMTP.
π§email_sender.txt
Code Gen
ROLE:
You are a senior Python developer building communication infrastructure.
CONTEXT:
- We need to send HTML emails as a backup to Telegram alerts
- Both Gmail and Yahoo are supported via SMTP with App Passwords
- Credentials are in config/notifications.json:
{
"email_provider": "gmail" | "yahoo",
"email_from": "you@gmail.com",
"email_app_password": "...",
"email_to": "alerts@you.com"
}
TASK:
Write scripts/email.py that exposes:
send_email(subject: str, body_html: str) -> bool
Requirements:
1. Look up SMTP server + port from provider:
gmail -> smtp.gmail.com:587
yahoo -> smtp.mail.yahoo.com:587
2. Use STARTTLS on port 587
3. Send MIME multipart with HTML body
4. Timeout 15s; one retry on failure
5. Log failures to logs/email.log
6. Return True on success
OUTPUT FORMAT:
Single Python file. No commentary. No markdown fences.
CONSTRAINTS:
- stdlib only (smtplib, email.mime, ssl, json, pathlib, logging)
- Never log the app password
App Passwords β Required
Both Gmail and Yahoo require an App Password for SMTP β not your regular login password. Enable 2FA on the account, then generate an app-specific password in the security settings.
Track 02 β AI MasteryTX-04
Yahoo Finance & Market Data
One prompt to generate a complete market data module β historical OHLCV, live quotes, VIX regime, anti-lookahead, the whole stack.
πmarket_data.txt
Code Gen
ROLE:
You are a quantitative developer building market data infrastructure.
CONTEXT:
- We use yfinance as the primary data source (free, no API key)
- All strategies read from this module β must be reliable
- Anti-lookahead bias is non-negotiable: signal generation uses .shift(1)
- Data must be cached locally so we don't re-download on every script
TASK:
Write scripts/market_data.py that exposes:
get_history(symbol: str, period: str = "1y", interval: str = "1d") -> DataFrame
Returns OHLCV DataFrame, cached for 1 hour in memory/cache/.
get_universe(symbols: list[str], period: str = "1y") -> DataFrame
Batch download. Returns multi-column DataFrame keyed by symbol.
get_vix() -> float
Returns the latest VIX close.
get_spy_regime() -> str
Returns "bullish" if SPY > SPY.SMA(50), else "bearish".
compute_signal(data: DataFrame, lookback: int = 30) -> DataFrame
Returns lookback-day % change SHIFTED by 1 (anti-lookahead).
OUTPUT FORMAT:
Single Python file. No commentary. No markdown fences.
Include type hints. Include docstrings on each public function.
CONSTRAINTS:
- Use yfinance, pandas, numpy only
- Cache to memory/cache/ as parquet files
- Stale cache after 3600s (1 hour)
Track 02 β AI MasteryTX-05
Skills & Tool Use
Tool use is the difference between a chatbot and an agent. This prompt produces a complete Claude tool-use loop with a real, working tool definition.
π οΈtool_use_loop.txt
Architecture
ROLE:
You are a senior Python developer building Claude agents with tool use.
CONTEXT:
- We use anthropic Python SDK with Claude Sonnet 4.6
- Agents need to be able to call functions β read files, query data, place orders
- The tool-use loop must handle multi-turn responses
TASK:
Write scripts/agent.py that:
1. Defines two tools using Claude's tool schema:
- get_positions() -> reads dashboard/trades.json
- get_quote(symbol: str) -> reads dashboard/quotes.json
2. Implements run_agent(system_prompt, user_message) that:
a. Sends initial message with both tools defined
b. If response has tool_use blocks, executes the local functions
c. Sends tool_result back in next turn
d. Loops until response is text-only
e. Returns the final text answer
3. Handles errors gracefully (tool errors do NOT crash the loop)
OUTPUT FORMAT:
Single Python file with both tool definitions and the loop.
Include a __main__ block: ask "What positions are open?" and print the answer.
CONSTRAINTS:
- Use anthropic SDK
- Max 6 tool-use turns before forcing text reply
- Log every tool call to logs/agent.log
The Tool-Use Loop Pattern
The most common bug in tool use is forgetting to loop. The model can call multiple tools across multiple turns before producing the final answer. Your code must keep feeding tool_result back until the response is pure text.
Track 02 β AI MasteryTX-06
Routines & Scheduling
Two prompts β one for macOS launchd, one for Linux cron/systemd. Pick the one for your platform and your firm runs itself.
β°launchd_suite.txt
macOS
ROLE:
You are a senior systems engineer building production schedulers on macOS.
CONTEXT:
- The firm has 6 recurring jobs that need to run automatically:
marketopen (8:55am ET Mon-Fri)
quotes (every 15 min)
sync (every 5 min)
execution (9:35am ET Mon-Fri)
heartbeat (every 5 min)
daily (4:30pm ET Mon-Fri)
- All scripts live under /Users/<you>/my-firm/scripts/
- Python runtime is /usr/local/bin/python3.14
TASK:
Generate 6 launchd plist files I can drop into ~/Library/LaunchAgents/.
Each plist must:
1. Label as com.firm.<jobname>
2. Use StartCalendarInterval for time-of-day jobs, StartInterval for intervals
3. Set KeepAlive=false (we don't want infinite restart on time-bounded jobs)
4. Redirect stdout to /tmp/<jobname>.out and stderr to /tmp/<jobname>.err
5. Pass the full python3.14 path + script path in ProgramArguments
OUTPUT FORMAT:
6 plist files concatenated, each prefixed with a comment line:
<!-- FILE: com.firm.marketopen.plist -->
No commentary outside the files themselves.
CONSTRAINTS:
- Use proper XML escaping
- Use absolute paths only
- Weekday entries: 1=Mon, 2=Tue, 3=Wed, 4=Thu, 5=Fri
π§linux_scheduling.txt
Linux
ROLE:
You are a senior systems engineer building production schedulers on Linux.
CONTEXT:
- Same 6 firm jobs as the macOS prompt
- Target system: Ubuntu 24.04 LTS
- Python at /usr/bin/python3.14
- User running them: 'firmuser'
TASK:
Generate BOTH cron and systemd versions:
VERSION 1 β crontab entries (single block):
Format: minute hour dom month dow command
Use absolute paths. Redirect output to /var/log/firm/<jobname>.log.
VERSION 2 β systemd timer + service pair for each job:
<jobname>.service β defines what to run, User=firmuser
<jobname>.timer β defines when, OnCalendar= or OnUnitActiveSec=
OUTPUT FORMAT:
Header "=== CRON ===" followed by the crontab block.
Header "=== SYSTEMD ===" followed by each .service / .timer file with FILE: comments.
CONSTRAINTS:
- No commentary outside the files
- Use absolute paths everywhere
Track 02 β AI MasteryTX-07
Agent Identity (AGENTS.md)
A meta-prompt: a prompt that generates the agent identity prompts. Hand this any role and it produces a production-ready AGENTS.md.
π§ agents_md_generator.txt
Meta
ROLE:
You are a senior agent designer. You write AGENTS.md identity files for
production AI agents in autonomous trading firms.
CONTEXT:
The firm runs on Paperclip with hub-and-spoke topology:
CEO -> routes work to: Research, Risk, Execution, Comms, Compliance
Each agent has an AGENTS.md file that defines its role completely.
TASK:
Given an agent role provided by the user, generate a complete AGENTS.md
with EXACTLY these sections in this order:
# <Role Name> Agent
## Role
<1-2 sentences describing the agent's job>
## Authority
<bullet list of what this agent CAN do>
## Hard Rules
<numbered list of non-negotiable rules β at least 4>
## Tools Available
<bullet list of functions/modules this agent can call>
## Escalation
<when and to whom this agent escalates>
## Tone
<one sentence on communication style>
OUTPUT FORMAT:
A single Markdown file. No commentary outside the file.
CONSTRAINTS:
- The "Hard Rules" section must include at least one rule about paper mode
- The "Tone" must be terse and factual
- Never include marketing language
Why a Meta-Prompt
You will create many agents over time. A meta-prompt ensures every one of them has the same structure β making them easy to read, easy to swap, and easy to debug as a group.
Track 02 β AI MasteryTX-08
Full-Stack Integration
The final prompt: a single bootstrap that wires Telegram + email + market data + Claude tools + dashboard into one unified notifier.
πunified_notifier.txt
Integration
ROLE:
You are a principal engineer integrating six existing modules into one
clean notification system.
CONTEXT:
We have these working modules in scripts/:
telegram.py -> send_telegram(msg, parse_mode)
email.py -> send_email(subject, body_html)
market_data.py -> get_vix(), get_spy_regime(), get_history()
agent.py -> run_agent(system_prompt, user_msg)
We need a single entry point: notifier.py that decides where alerts go.
TASK:
Write scripts/notifier.py that exposes:
notify(message: str, level: str = "info") -> dict
Routing rules:
level "debug" -> log only (no send)
level "info" -> Telegram only
level "warning" -> Telegram + log
level "critical" -> Telegram + email + log
level "error" -> Telegram + email + log + halt-check
Behavior:
- Returns dict: {"telegram": bool, "email": bool, "logged": bool}
- On critical/error, also writes to memory/HALT-PENDING (requires human resume)
- On Telegram failure for warning+, fall back to email automatically
- Every call writes one line to logs/notifier.log
OUTPUT FORMAT:
Single Python file. No commentary. No markdown fences.
CONSTRAINTS:
- Re-use existing modules, do not reimplement
- No new external dependencies
- Each notification level must be testable independently
The Punchline
Eight prompts. Eight modules. One firm. Run each prompt through Claude or Codex and you have the complete communication, data, scheduling, and agent stack β built in an afternoon instead of a quarter.
You've Got the Prompts. Now Build the Firm.
Every prompt in this course was extracted from the live DeadCatFound trading firm. Combined with Track 01 (Military Money), you have the complete blueprint.
DeadCatFound is an educational platform only. We are not a registered financial advisor, broker-dealer, investment advisor, or financial institution of any kind. Nothing in this course constitutes financial advice, investment advice, or any recommendation to buy or sell any security.
All content is for educational and informational purposes only. Trading involves substantial risk of loss. Always consult a licensed financial professional. By accessing this course you acknowledge that DeadCatFound bears no liability for any financial outcomes.