lennoxsaint/Threadify-workflows / plugins/claude/skills/threadify-run-my-threads
threadify-run-my-threads
VerifiedSet up one daily schedule so your agent prepares five Threadify-written Threads posts every morning from a weekly plan (one long-form thread on six days, one greatest-hit repost a day, hook-first structures and a chosen CTA level), shows them in this thread, and schedules them only after you reply "yes". Use when someone asks Threadify to run their Threads, prepare posts every morning for approval, or says "I want to approve posts, not write them".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 21.0 KB |
| references/daily-schedule.md | markdown | 6.0 KB |
| references/generation-models.json | config | 932 B |
| references/hook-bank.md | markdown | 976 B |
| references/state-and-recovery.md | markdown | 3.5 KB |
| references/threadify-001.md | markdown | 3.7 KB |
| references/threads-playbook.md | markdown | 2.7 KB |
| references/workflow-manifest.json | config | 4.4 KB |
| references/workflow-readme.md | markdown | 1.0 KB |
| scripts/casing-guard.mjs | script | 6.6 KB |
| scripts/hook-check.mjs | script | 7.2 KB |
| scripts/run-state.mjs | script | 9.5 KB |
| scripts/week-plan.mjs | script | 14.2 KB |
scripts/casing-guard.mjs
View on GitHub#!/usr/bin/env node
// Casing-only guard against the latest owner-authorized wording revision.
// Requested wording edits are recorded separately in run-state.mjs.
//
// node casing-guard.mjs check < {"posts":[{"id","original","final","keep"?}]}
// node casing-guard.mjs lowercase < {"posts":[{"id","original","keep"}]}
//
// `original` and `final` are a string or an array of thread parts. Output is
// JSON on stdout. Exit 0 when every post passes, 1 on any FAIL or bad input.
// No dependencies and no network: Node 18+ only.
import crypto from 'node:crypto';
import { realpathSync } from 'node:fs';
import { pathToFileURL } from 'node:url';
const WORD = /[\p{L}\p{M}\p{N}]+/gu;
// Links, handles and hashtags stay exactly as Threadify wrote them: a
// lowercased URL path can break the link.
const PROTECTED = /https?:\/\/\S+|www\.\S+|\b[\p{L}\p{N}-]+(?:\.[\p{L}\p{N}-]+)+\/\S*|[@#][\p{L}\p{N}_.]+/giu;
const sha256 = (text) => crypto.createHash('sha256').update(text).digest('hex');
const parts = (value) => (Array.isArray(value) ? value : [value]);
function keepSet(keep = []) {
if (!Array.isArray(keep)) throw new Error('keep must be an array of proper nouns');
// "New York" keeps both words; "I" keeps the I in "I'm" and "I've".
return new Set(keep.flatMap((entry) => String(entry).match(WORD) ?? []));
}
/** Lowercase one text, leaving keep-listed words, links, handles and hashtags unchanged. */
export function lowercaseExceptProperNouns(text, keep = []) {
if (typeof text !== 'string') throw new Error('text must be a string');
const kept = keepSet(keep);
let out = '';
let last = 0;
for (const match of text.matchAll(PROTECTED)) {
out += lowerSegment(text.slice(last, match.index), kept) + match[0];
last = match.index + match[0].length;
}
return out + lowerSegment(text.slice(last), kept);
}
function lowerSegment(segment, kept) {
return segment.replace(WORD, (word) => (kept.has(word) ? word : word.toLowerCase()));
}
/** Split a text into its words and the exact text between them. */
function pieces(text) {
const words = [];
const gaps = [];
let last = 0;
for (const match of text.matchAll(WORD)) {
gaps.push(text.slice(last, match.index));
words.push(match[0]);
last = match.index + match[0].length;
}
gaps.push(text.slice(last));
return { words, gaps };
}
const protectedSpans = (text) => Array.from(text.matchAll(PROTECTED), (match) => match[0]);
/**
* PASS only when `final` is `original` with zero or more whole words lowercased.
* Word by word, each final word equals the original word or its lowercase (so
* context-sensitive mappings such as Greek final sigma or Turkish İ pass), and
* everything between words (punctuation, spacing, emoji, line breaks) is
* identical. Links, @handles and #hashtags must match exactly, case included.
* When `keep` is given, a lowercased proper noun fails.
*/
export function checkText(original, final, keep) {
if (typeof original !== 'string' || typeof final !== 'string') {
throw new Error('original and final must be strings');
}
const reasons = [];
const before = pieces(original);
const after = pieces(final);
const sameShape =
before.words.length === after.words.length && before.gaps.every((gap, index) => gap === after.gaps[index]);
if (!sameShape) {
reasons.push('wording_changed');
} else {
before.words.forEach((word, index) => {
const next = after.words[index];
if (next === word || next === word.toLowerCase()) return;
reasons.push(next.toLowerCase() === word.toLowerCase() ? `casing_not_lowercase:${word}` : `wording_changed:${word}`);
});
}
const spansBefore = protectedSpans(original);
const spansAfter = protectedSpans(final);
if (spansBefore.length !== spansAfter.length || spansBefore.some((span, index) => span !== spansAfter[index])) {
reasons.push('protected_span_changed');
}
if (!reasons.length && keep !== undefined) {
const kept = keepSet(keep);
before.words.forEach((word, index) => {
if (kept.has(word) && after.words[index] !== word) reasons.push(`proper_noun_lowercased:${word}`);
});
}
return { status: reasons.length ? 'FAIL' : 'PASS', unchanged: original === final, reasons };
}
/** Check one post (single text or thread parts). */
export function checkPost({ id = null, original, final, keep }) {
const before = parts(original);
const after = parts(final);
if (before.length !== after.length) {
return { id, status: 'FAIL', unchanged: false, reasons: ['thread_parts_changed'], final_sha256: sha256(JSON.stringify(after)) };
}
const results = before.map((text, index) => checkText(text, after[index], keep));
const reasons = results.flatMap((result, index) => result.reasons.map((reason) => (before.length > 1 ? `part_${index + 1}:${reason}` : reason)));
return {
id,
status: reasons.length ? 'FAIL' : 'PASS',
unchanged: results.every((result) => result.unchanged),
reasons,
final_sha256: sha256(JSON.stringify(after)),
};
}
export function checkPosts(input) {
if (!Array.isArray(input?.posts) || input.posts.length === 0) throw new Error('posts must be a non-empty array');
const posts = input.posts.map(checkPost);
return { status: posts.every((post) => post.status === 'PASS') ? 'PASS' : 'FAIL', posts };
}
export function lowercasePosts(input) {
if (!Array.isArray(input?.posts) || input.posts.length === 0) throw new Error('posts must be a non-empty array');
const posts = input.posts.map(({ id = null, original, keep = [] }) => {
const final = Array.isArray(original)
? original.map((text) => lowercaseExceptProperNouns(text, keep))
: lowercaseExceptProperNouns(original, keep);
return { ...checkPost({ id, original, final, keep }), final };
});
return { status: posts.every((post) => post.status === 'PASS') ? 'PASS' : 'FAIL', posts };
}
async function readStdin() {
let data = '';
for await (const chunk of process.stdin) data += chunk;
return JSON.parse(data);
}
async function main(argv) {
const [command] = argv;
if (!['check', 'lowercase'].includes(command)) throw new Error('usage: casing-guard.mjs check|lowercase < input.json');
const input = await readStdin();
const result = command === 'check' ? checkPosts(input) : lowercasePosts(input);
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
if (result.status !== 'PASS') process.exitCode = 1;
}
if (process.argv[1] && import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) {
main(process.argv.slice(2)).catch((error) => {
process.stderr.write(`${JSON.stringify({ status: 'failed', error: error.message })}\n`);
process.exitCode = 1;
});
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |