Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/microck-workflow-management/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 37% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -2% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 15% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 196% | 0% |
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.tsWorkflows are defined using QStash SDK:
typescriptimport { 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:
typescriptawait 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:
bashpnpm -F @sgcarstrends/api test -- src/lib/workflows
Test individual workflow locally:
bash# 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 documentation| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-04 | fail→pass | 13,952 | 4,602 | -67% | 1 | 1 | 0% | 1,251 | 1,714 | +37% | 0 | 0 | — |
case-01 | fail→pass | 14,154 | 12,148 | -14% | 1 | 1 | 0% | 2,666 | 3,166 | +19% | 0 | 0 | — |
case-02 | fail→pass | 12,655 | 6,138 | -51% | 1 | 1 | 0% | 2,131 | 2,093 | -2% | 0 | 0 | — |
case-03 | fail→pass | 12,360 | 10,161 | -18% | 1 | 1 | 0% | 2,486 | 2,854 | +15% | 0 | 0 | — |
case-05 | pass→pass | 12,333 | 5,755 | -53% | 1 | 1 | 0% | 2,204 | 1,889 | -14% | 0 | 0 | — |
case-06 | pass→pass | 7,184 | 3,323 | -54% | 1 | 1 | 0% | 985 | 1,421 | +44% | 0 | 0 | — |
case-07 | pass→pass | 7,293 | 2,012 | -72% | 1 | 1 | 0% | 1,221 | 1,323 | +8% | 0 | 0 | — |
case-08 | fail→pass | 3,411 | 2,614 | -23% | 1 | 1 | 0% | 448 | 1,326 | +196% | 0 | 0 | — |
case-09 | pass→pass | 9,301 | 1,587 | -83% | 1 | 1 | 0% | 1,512 | 1,139 | -25% | 0 | 0 | — |
case-10 | fail→pass | 6,723 | 2,070 | -69% | 1 | 1 | 0% | 920 | 1,156 | +26% | 0 | 0 | — |
case-11 | fail→pass | 10,177 | 1,337 | -87% | 1 | 1 | 0% | 1,773 | 1,133 | -36% | 0 | 0 | — |
case-12 | pass→pass | 6,856 | 1,595 | -77% | 1 | 1 | 0% | 1,085 | 1,183 | +9% | 0 | 0 | — |
case-13 | pass→pass | 17,554 | 13,047 | -26% | 1 | 1 | 0% | 3,004 | 3,028 | +1% | 0 | 0 | — |
case-14 | fail→pass | 13,421 | 6,703 | -50% | 1 | 1 | 0% | 2,277 | 2,093 | -8% | 0 | 0 | — |
case-15 | fail→pass | 14,898 | 6,038 | -59% | 1 | 1 | 0% | 2,321 | 2,041 | -12% | 0 | 0 | — |
case-16 | pass→pass | 4,916 | 10,482 | +113% | 1 | 1 | 0% | 730 | 1,702 | +133% | 0 | 0 | — |
case-17 | pass→pass | 14,626 | 27,037 | +85% | 1 | 1 | 0% | 2,598 | 3,219 | +24% | 0 | 0 | — |
case-18 | pass→pass | 4,286 | 2,500 | -42% | 1 | 1 | 0% | 725 | 1,295 | +79% | 0 | 0 | — |
case-19 | pass→pass | 9,582 | 5,037 | -47% | 1 | 1 | 0% | 1,455 | 1,540 | +6% | 0 | 0 | — |
case-20 | pass→pass | 6,380 | 5,013 | -21% | 1 | 1 | 0% | 1,155 | 1,715 | +48% | 0 | 0 | — |
case-21 | pass→pass | 10,578 | 11,037 | +4% | 1 | 1 | 0% | 2,155 | 3,020 | +40% | 0 | 0 | — |
case-22 | pass→pass | 11,319 | 8,744 | -23% | 1 | 1 | 0% | 2,026 | 2,534 | +25% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +41 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.