General
PromptBeginner5 minmarkdown
Untitled Skill
193
Schedule a draft blog post for future publication
Loading actions...
Main instructions and any bundled files for this skill.
TypeScript and ESLint rules that MUST be followed when creating, modifying, or reviewing any file under apps/frontend/, including .ts, .tsx, .js, and .jsx files. Also apply when discussing frontend li...
risks
Schedule a completed draft to be published at a future date.
slug: The slug of the draft to schedule (e.g., "my-blog-post")date: The publish date in YYYY-MM-DD format (e.g., "2025-01-15")
const args = '$ARGUMENTS'.split(' ');
const slug = args[0];
let dateArg = args[1] || '';
// Default to 9am EST if no time provided
if (!dateArg.includes('T')) {
dateArg = `${dateArg}T09:00:00-05:00`;
}
const scheduledDate = new Date(dateArg);
if (isNaN(scheduledDate.getTime())) {
throw new Error('Invalid date format. Use YYYY-MM-DD or YYYY-MM-DDTHH:MM');
}
Check if the draft has already been uploaded to Sanity, or create it:
import * as sanity from './servers/sanity';
import * as fs from 'fs';
const draftPath = `./drafts/${slug}.md`;
if (!fs.existsSync(draftPath)) {
throw new Error(`Draft not found: ${draftPath}`);
}
// Check for existing Sanity document or create new one
// Then schedule it
const result = await sanity.schedulePost(documentId, scheduledDate.toISOString());
console.log(`Scheduled for: ${scheduledDate.toLocaleString()}`);
Mark the keyword as 'scheduled' in Supabase (not 'published' until it actually goes live).
Scheduling post for future publication...
✓ Draft found: ./drafts/my-blog-post.md
✓ Post scheduled in Sanity
📅 Scheduled Publication
Title: Your Blog Post Title
Slug: my-blog-post
Publish Date: January 15, 2025 at 9:00 AM EST
The post will automatically go live at this time.
To view scheduled posts, run /queue-status.
/schedule my-blog-post 2025-01-15
/schedule getting-started 2025-01-20T14:00
/schedule complete-guide 2025-02-01