One safe chain
Do not ask one prompt to understand, decide, write, and verify at the same time. Split the task into small calls where each call has one job and a clear output.
The safe pattern is: extract facts, check facts, generate answer, then review answer.
Why split tasks
Large prompts fail quietly when they handle too many goals. They may skip a rule, invent a detail, or return a neat answer based on bad input.
Splitting makes each step easier to test. It also lets your app stop early when the model is unsure or the user gave missing details.
Use a gate
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 5 done
Example flow
Suppose your hackathon project helps students turn a messy WhatsApp internship post into a clean application checklist.
Do not generate the final checklist directly. First extract fields. Then validate. Then draft the checklist.
User text:
"Hiring backend intern. Pune. 3 months. Stipend 15k. Send resume and GitHub by Friday to [email protected]"
Call 1: Extract
Return JSON with role, location, duration, stipend, deadline, contact, required_documents.
Call 2: Validate
Check if any field is missing or unclear. Return {"ok": true/false, "missing": [], "risks": []}.
Call 3: Draft
Only if ok is true, write a student-friendly checklist using the extracted JSON.Common mistake
Beginners split tasks but still pass the full messy input to every step. Then the final step may ignore the cleaned data and use the original text again.
Pass the final step only the checked JSON, not the raw user text. This keeps the answer tied to facts your app already approved.
Name each step
Use simple names in your code and README: extract_post, validate_post, draft_checklist. This helps judges understand your AI flow fast.
When you test later, save the input and output for each step. A broken chain is easier to debug when every link is visible.
Tiny code pattern
This is the control flow you want. The exact model call can be OpenAI, Gemini, Claude, or another API your team is using.
async function makeChecklist(rawPost) {
const extracted = await extractPost(rawPost);
const validation = await validatePost(extracted);
if (!validation.ok) {
return {
status: "needs_more_info",
message: "Please add: " + validation.missing.join(", ")
};
}
const checklist = await draftChecklist(extracted);
return {
status: "ready",
checklist
};
}Do this now
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 5 done