davila7/claude-code-templates / cli-tool/components/skills/development/pudu-task-telemetry
pudu-task-telemetry
VerifiedMeasure local AI task latency, token usage, errors and verified outcomes using Pudu AI hardware evidence and installed Ollama models. Use when comparing local task runs, choosing a local model for a bounded subtask, or recording reproducible task telemetry.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.9 KB |
| references/examples.md | markdown | 3.2 KB |
| references/model-selection.md | markdown | 3.0 KB |
| references/setup.md | markdown | 3.0 KB |
| references/task-schema.json | config | 5.7 KB |
| references/telemetry-contract.md | markdown | 4.4 KB |
| scripts/lib/common.mjs | script | 1.8 KB |
| scripts/lib/model-selection.mjs | script | 3.5 KB |
| scripts/lib/ollama-adapter.mjs | script | 10.5 KB |
| scripts/lib/pudu-adapter.mjs | script | 4.7 KB |
| scripts/lib/report.mjs | script | 4.6 KB |
| scripts/lib/task-store.mjs | script | 8.4 KB |
| scripts/lib/telemetry.mjs | script | 3.0 KB |
| scripts/pudu-task.mjs | script | 12.7 KB |
scripts/lib/common.mjs
View on GitHubimport { createHash } from 'node:crypto';
import { readFile, stat } from 'node:fs/promises';
export class TaskError extends Error {
constructor(code, message, exitCode = 2) {
super(message);
this.code = code;
this.exitCode = exitCode;
}
}
export const fail = (code, message, exitCode) => { throw new TaskError(code, message, exitCode); };
export const hash = value => createHash('sha256').update(typeof value === 'string' || Buffer.isBuffer(value) ? value : JSON.stringify(value)).digest('hex');
export const object = value => value !== null && typeof value === 'object' && !Array.isArray(value);
export function check(condition, message, code = 'invalid_input', exitCode = 2) {
if (!condition) fail(code, message, exitCode);
}
export function identifier(value, label = 'identifier') {
check(typeof value === 'string' && /^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/.test(value), `Invalid ${label}.`);
return value;
}
export async function inputFile(file, json = true) {
try {
check((await stat(file)).size <= 4 * 1024 * 1024, 'Input exceeds 4 MiB.');
const data = await readFile(file, 'utf8');
return json ? JSON.parse(data) : data;
} catch (error) {
if (error instanceof TaskError) throw error;
fail('invalid_input', 'Cannot read input file or parse JSON.');
}
}
export function publicError(error) {
return error instanceof TaskError
? { code: error.code, message: error.message }
: { code: 'internal_error', message: 'Operation failed; raw diagnostics are omitted to protect local data.' };
}
export const median = values => {
if (!values.length) return null;
const sorted = [...values].sort((a, b) => a - b);
const mid = Math.floor(sorted.length / 2);
return sorted.length % 2 ? sorted[mid] : (sorted[mid - 1] + sorted[mid]) / 2;
};
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |