Add the following to your existing Skill instructions to save analysis results to WellNote after each run.
1. Environment Variables
Add these to the Skill's environment config (alongside any existing vars):
2. Append to Skill Instructions
Paste the following at the end of your Skill's instruction file. The Skill will run its original logic first, then insert the results.
## Post-Analysis: Save to WellNote
import os
import requests
url = os.environ["WELL_DB_URL"]
headers = {
"apikey": os.environ["WELL_DB_ANON_KEY"],
"Authorization": f"Bearer {os.environ['WELL_TOKEN']}",
"Content-Type": "application/json",
"Prefer": "return=minimal"
}
payload = {
"title": "Energy Sector",
"summary": section_content,
"symbols": ["000767", "600310"]
}
res = requests.post(url, headers=headers, json=payload, timeout=15)
if res.status_code not in (200, 201):
raise RuntimeError(f"WellNote insert failed: {res.status_code} {res.text}")
title: section topic or sector name. summary: Markdown text (ensure blank line before tables/lists). symbols: array of stock codes.