skills_all/workflow-management/SKILL.md
Create, debug, or modify QStash workflows for data updates and social media posting in the API service. Use when adding new automated jobs, fixing workflow errors, or updating scheduling logic.
npx skillsauth add activer007/ordinary-claude-skills workflow-managementInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill helps you work with QStash-based workflows in apps/api/src/lib/workflows/.
The project uses QStash workflows with the following structure:
apps/api/src/lib/workflows/
├── cars/ # Car registration data workflows
│ └── update.ts # Scheduled car data updates
├── coe/ # COE bidding data workflows
│ └── update.ts # Scheduled COE data updates
└── social/ # Social media posting workflows
├── discord.ts
├── linkedin.ts
├── telegram.ts
└── twitter.ts
Workflows are defined using QStash SDK:
import { serve } from "@upstash/workflow";
export const POST = serve(async (context) => {
// Step 1: Fetch data
await context.run("fetch-data", async () => {
// Fetching logic
});
// Step 2: Process data
const processed = await context.run("process-data", async () => {
// Processing logic
});
// Step 3: Store results
await context.run("store-results", async () => {
// Storage logic
});
});
Workflows are triggered via cron schedules configured in:
infra/)Always include comprehensive error handling:
await context.run("step-name", async () => {
try {
// Logic here
} catch (error) {
console.error("Step failed:", error);
// Log to monitoring service
throw error; // Re-throw for workflow retry
}
});
context.run()apps/api/src/routes/Workflows typically need:
DATABASE_URL - PostgreSQL connectionUPSTASH_REDIS_REST_URL / UPSTASH_REDIS_REST_TOKEN - RedisQSTASH_TOKEN - QStash authenticationRun workflow tests:
pnpm -F @sgcarstrends/api test -- src/lib/workflows
Test individual workflow locally:
# Start dev server
pnpm dev
# Trigger workflow via HTTP
curl -X POST http://localhost:3000/api/workflows/cars/update
apps/api/src/routes/workflows.ts - Workflow route handlersapps/api/src/config/qstash.ts - QStash configurationapps/api/CLAUDE.md - API service documentationtools
Generate typed TypeScript SDKs for AI agents to interact with MCP servers. Converts verbose JSON-RPC curl commands to clean function calls (docs.createDocument() vs curl). Auto-detects MCP tools from server modules, generates TypeScript types and client methods, creates runnable example scripts. Use when: building MCP-enabled applications, need typed programmatic access to MCP tools, want Claude Code to manage apps via scripts, eliminating manual JSON-RPC curl commands, validating MCP inputs/outputs, or creating reusable agent automation.
testing
Generate structured task lists from specs or requirements. IMPORTANT: After completing ANY spec via ExitSpecMode, ALWAYS ask the user: "Would you like me to generate a task list for this spec?" Use when user confirms or explicitly requests task generation from a plan/spec/PRD.
tools
Create compelling story-format summaries using UltraThink to find the best narrative framing. Support multiple formats - 3-part narrative, n-length with inline links, abridged 5-line, or comprehensive via Foundry MCP. USE WHEN user says 'create story explanation', 'narrative summary', 'explain as a story', or wants content in Daniel's conversational first-person voice.
testing
Navigate through the original three-world shamanic technology. Deploy when soul retrieval, power animal guidance, or journey between realms emerges. Deeply respectful of Tungus, Buryat, Yakut, Evenki traditions. Use for consciousness navigation, NOT cultural appropriation.