Context Health Check

<%*

ses770227 Updated

File contents

<%* // Configuration const python = "/Users/samuelxiang/Library/Mobile Documents/iCloudmdobsidian/Documents/SamHigh/Scripts/AgentSkills/.venv/bin/python"; const script = "/Users/samuelxiang/Library/Mobile Documents/iCloudmdobsidian/Documents/SamHigh/Scripts/AgentSkills/obsidian_bridge.py";

// Get file content const content = tp.file.content; if (!content) { new Notice("File is empty!"); return; }

// Escape content for shell (double quotes and backslashes) // 1. Escape backslashes first // 2. Escape double quotes const safeContent = content.split("\").join("\\").split('"').join('"');

// Construct command // python path and script path need quotes because of spaces in "Mobile Documents" const cmd = "${python}" "${script}" analyze_context "${safeContent}";

try { // Check if user function exists if (!tp.user.run_cmd) { throw new Error("User function 'run_cmd' not found. Please check Templater settings."); }

new Notice("Analyzing context...");
const result = await tp.user.run_cmd(cmd);
tR += "\n" + result;

} catch (e) { tR += \n> [!error] Template Error\n> ${e.message}; } %>

ses770227/awesome-agent-skills/tree/main/skills/context-health-check commit 27ab5023e0

Frequently asked questions

npx skillmds@latest add ses770227/context-health-check