Newsletter Monitor
Convert the `newsletter-monitor` skill into a repeatable AgentMail newsletter signal scan. Scan an AgentMail inbox for newsletter signals using configurable keyword campaigns. Extracts matched keywords, context snippets, and company mentions from incoming emails. Use for monitori
6 steps · start to finish.
- 1Step 1
Environment Setup
▶set -euo pipefail RESULTS_DIR="${RESULTS_DIR:-/app/results}" mkdir -p "$RESULTS_DIR" "$RESULTS_DIR/work" if [ -z "${{AGENTMAIL_API_KEY:-}}" ]; then echo "ERROR: AGENTMAIL_API_KEY is not set" exit 1 fi command -v python3 >/dev/null || {{ echo "ERROR: python3 not installed"; exit 1; }} command -v pip3 >/dev/null || {{ echo "ERROR: pip3 not installed"; exit 1; }} pip3 install agentmail python-dotenv - 2Step 2
Resolve Scan Parameters
▶Resolve orchestration inputs into CLI arguments. Only include optional flags when values are provided so defaults from the source skill remain intact.
- 3Step 3
Run Newsletter Scan
▶Run both JSON and summary modes. The JSON output is used for downstream processing and validation; the summary output is kept for human review.
- 4Step 4
Validate Outputs
▶Validate that the scan produced parseable JSON and that the required summary artifacts exist.
- 5Step 5
Iterate on Errors (max 3 rounds)
▶If setup, scanning, or output validation fails, retry up to max 3 rounds after applying the relevant correction.
- 6Step 6
Write Reports
▶set -euo pipefail