.claude/skills/morning-audit/SKILL.md
# Morning-After Audit Comprehensive daily check of system health, signal pipeline, and trading performance. Run after a full trading day has passed. ## Prerequisites - MongoDB connection string is in `.env.local` on droplet as `MONGO_CONNECTION_STRING` (Atlas, not local) - Use the Atlas URI for `mongosh`: `mongosh "mongodb+srv://..." --quiet` - Batch SSH commands to avoid fail2ban rate limiting (max 3 parallel SSH sessions) ## Steps Run these three SSH commands in parallel: ### Command 1:
npx skillsauth add tadams95/kardashev-network .claude/skills/morning-auditInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive daily check of system health, signal pipeline, and trading performance. Run after a full trading day has passed.
.env.local on droplet as MONGO_CONNECTION_STRING (Atlas, not local)mongosh: mongosh "mongodb+srv://..." --quietRun these three SSH commands in parallel:
ssh [email protected] 'cd /var/www/kardashev && mongosh "$(grep MONGO_CONNECTION_STRING .env.local | cut -d= -f2-)" --quiet --eval "
db = db.getSiblingDB(\"kardashev\");
// 1. TAIL SELL SIGNALS
print(\"=== 1. TAIL SELL SIGNALS ===\");
print(\"Total: \" + db.tail_sell_signals.countDocuments({}));
print(\"Pending: \" + db.tail_sell_signals.countDocuments({ result: \"pending\" }));
print(\"Win: \" + db.tail_sell_signals.countDocuments({ result: \"win\" }));
print(\"Loss: \" + db.tail_sell_signals.countDocuments({ result: \"loss\" }));
print(\"\nRecent signals:\");
db.tail_sell_signals.find({}, { _id:0, cityCode:1, bracket:1, forecastF:1, marketPrice:1, direction:1, result:1, pnlCents:1, timestamp:1, resolvedAt:1 }).sort({ timestamp: -1 }).limit(10).forEach(r => print(JSON.stringify(r)));
// 2. FORECAST ACCURACY (last 24h)
print(\"\n=== 2. FORECAST ACCURACY (24h) ===\");
var cutoff = Date.now() - 86400000;
print(\"temp_bias docs: \" + db.temp_bias.countDocuments({ timestamp: { \\\$gte: cutoff } }));
printjson(db.temp_bias.aggregate([
{ \\\$match: { timestamp: { \\\$gte: cutoff }, marketType: \"high\" } },
{ \\\$group: { _id: null, count: { \\\$sum: 1 }, mae: { \\\$avg: { \\\$abs: \"\\\$error\" } }, bias: { \\\$avg: \"\\\$error\" } } }
]).toArray());
// 3. SIGNAL PIPELINE
print(\"\n=== 3. RECENT PREDICTIONS ===\");
db.market_predictions.find({}, { _id:0, cityCode:1, marketType:1, rawProbability:1, correctedProbability:1, calibrationModelId:1, timestamp:1 }).sort({ timestamp: -1 }).limit(5).forEach(p => print(JSON.stringify(p)));
// 4. RESOLUTION STATUS
print(\"\n=== 4. RESOLUTION STATUS ===\");
print(\"Total signals: \" + db.signals.countDocuments({}));
print(\"Resolved (outcome exists): \" + db.signals.countDocuments({ outcome: { \\\$exists: true } }));
print(\"Unresolved: \" + db.signals.countDocuments({ outcome: { \\\$exists: false } }));
var latest = db.signals.find({ outcome: { \\\$exists: true } }).sort({ resolvedAt: -1 }).limit(1).toArray();
if (latest.length) print(\"Last resolved: \" + new Date(latest[0].resolvedAt).toISOString() + \" \" + latest[0].marketId);
"'
ssh [email protected] 'cd /var/www/kardashev && npx tsx --tsconfig tsconfig.json scripts/audit-tail-sells.ts 2>&1'
ssh [email protected] 'echo "=== PM2 ===" && pm2 jlist 2>/dev/null | python3 -c "import sys,json; d=json.load(sys.stdin); [print(f\"{p[\"name\"]}: {p[\"pm2_env\"][\"status\"]}, pid={p[\"pid\"]}, restarts={p[\"pm2_env\"][\"restart_time\"]}\") for p in d]" && echo "=== ERRORS (non-ratelimit) ===" && pm2 logs kardashev-web --lines 100 --nostream 2>&1 | grep -iE "error|FATAL|unhandled" | grep -v "Tomorrow.io" | grep -v "rate limit" | tail -10 && echo "=== RESOLVE-MARKETS LAST RUN ===" && grep "Signals resolved:" /var/log/resolve-markets.log | tail -4 && echo "=== REDIS ===" && redis-cli PING && redis-cli INFO memory 2>/dev/null | grep -E "used_memory_human|maxmemory_human|evicted_keys"'
Output five labeled sections:
| Metric | Clean-Era Baseline | Alert Threshold |
|--------|-------------------|-----------------|
| MAE (high) | 1.88°F | > 3.0°F |
| Bias (high) | -1.37°F | abs > 3.0°F |
| Calibration model | cal_1774664539928 | Missing or changed |
| Resolution staleness | — | > 36h since last |
mongosh without the connection string.outcome field (boolean) = resolution status in signals collection. NOT resolvedOutcome.autorestart: false). System crontab is the primary trigger.104.248.223.48development
Web3 integration with wagmi and viem - wallet connection, contract interactions, transactions, RainbowKit. Use when implementing wallet features, reading/writing contracts, or handling blockchain transactions.
content-media
Three.js textures - loading, configuration, UV mapping, environment maps. Use when loading images, configuring texture properties, or working with HDR environments.
data-ai
Three.js shaders - GLSL, ShaderMaterial, uniforms, custom effects. Use when creating custom visual effects, modifying vertices, writing fragment shaders, or extending built-in materials.
testing
Three.js post-processing - EffectComposer, bloom, depth of field, custom passes. Use when adding visual effects, screen-space effects, or enhancing rendered output.