lennoxsaint/Threadify-workflows / plugins/openai/skills/threadify-30-day-viral-vault
threadify-30-day-viral-vault
VerifiedPlan 30 days and prepare six rights-cleared Threads posts daily while revealing only the next unresolved card. Use for a 30-Day Viral Vault or a six-post one-at-a-time daily queue.
scripts/engine/automation.mjs
View on GitHubconst assert = (value, message) => {
if (!value) throw new Error(message);
};
export function validateAutomation(value, plug = false, draft = false) {
if (value === null) return;
assert(value && Object.getPrototypeOf(value) === Object.prototype, 'Invalid automation.');
const allowed = plug
? ['content', 'trigger', 'delay_minutes', 'likes_threshold']
: ['trigger', 'delay_minutes', 'likes_threshold'];
assert(
Object.keys(value).every((field) => allowed.includes(field)),
'Unknown automation field.',
);
assert(['time', 'likes'].includes(value.trigger), 'Choose a time or likes trigger.');
if (plug)
assert(
typeof value.content === 'string' &&
(draft || value.content.trim().length > 0) &&
[...value.content].length <= (draft ? 20000 : 500),
'Auto Plug needs 1–500 characters.',
);
const field = value.trigger === 'time' ? 'delay_minutes' : 'likes_threshold';
assert(
draft ? Number.isFinite(value[field]) : Number.isSafeInteger(value[field]) && value[field] >= (field === 'delay_minutes' ? 5 : 1),
'Invalid automation trigger value.',
);
assert(
value[field === 'delay_minutes' ? 'likes_threshold' : 'delay_minutes'] === undefined,
'Use only the selected trigger.',
);
}
export function validateGlobalRepost(value) {
assert(
value && typeof value.known === 'boolean' && typeof value.enabled === 'boolean',
'Explicit account-wide Auto Repost state required.',
);
assert(
Object.keys(value).every((field) =>
['known', 'enabled', 'trigger', 'delay_minutes', 'likes_threshold'].includes(field),
),
'Unknown account-wide Auto Repost field.',
);
if (value.enabled) {
assert(
value.known && ['time', 'likes'].includes(value.trigger),
'Enabled account-wide Auto Repost requires known settings.',
);
const field = value.trigger === 'time' ? 'delay_minutes' : 'likes_threshold';
assert(
Number.isSafeInteger(value[field]) && value[field] >= (value.trigger === 'time' ? 5 : 1),
'Invalid account-wide Auto Repost trigger.',
);
}
}
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: 198k | 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: 196k | 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: 196k | 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: 196k | Updated | Claude CodeCodex | Verified | Install |