meal-planner · Guide

How does MealPlanner build the week?

Last updated: 2026-09-16

Set a goal and dietary restrictions and it returns a 7-day plan of simple meals, so you eat better without a spreadsheet or a meal-prep obsession.

Use the main workspace, enter the required inputs, and edit the draft before you rely on it.

How you tell MealPlanner what you want

I start by asking you to type a short goal statement. This could be “lose two pounds this week”, “add more protein to lunch”, or “keep dinner under 500 calories”. The goal field accepts free text and I store it as a plain string that drives later calorie and macro targets.

Next you pick any dietary restrictions that apply to you. Options include vegetarian, vegan, gluten‑free, dairy‑free, nut‑free, low‑FODMAP, kosher, halal, and diabetic‑friendly. You can select multiple items; each selection adds a rule to the filter engine that will later remove incompatible recipes.

You also set the number of servings per meal and the maximum time you are willing to spend cooking on a busy day. Serving size defaults to one but you can increase to feed a family. Prep time limit is entered in minutes and influences which recipes are considered feasible for weeknight cooking.

All of these inputs are saved in the workspace as a JSON object. I validate that the goal is not empty and that at least one restriction is chosen if you have special needs. If validation fails I show an inline hint asking you to complete the missing field before proceeding.

How the goal shapes nutrition targets

Calorie calculation

I take your goal and translate it into a daily calorie target. For weight loss I subtract a moderate deficit from your estimated maintenance level. For maintenance I keep the estimate unchanged. For muscle gain I add a modest surplus. The maintenance estimate uses the Mifflin‑St Jeor equation with the age, weight, height, and sex you optionally provide in your profile; if those fields are blank I fall back to population averages based on the goal you entered.

Macro split

After calories are set I allocate protein, fat, and carbohydrate grams. A higher‑protein goal gets 30 % of calories from protein, 30 % from fat, and 40 % from carbs. A balanced goal uses 20 % protein, 30 % fat, 50 % carbs. A low‑carb goal shifts to 25 % protein, 50 % fat, 25 % carbs. These ratios are stored as multipliers that later filter recipes by macro density.

Adjustments for restrictions

If you selected vegetarian I reduce the allowed meat protein sources and increase legume and tofu options. For gluten‑free I remove any recipe that lists wheat, barley, or rye as an ingredient. Each restriction triggers a lookup table that tags ingredients as allowed or disallowed; the system then excludes any recipe containing a disallowed tag.

How the dietary filter engine works

Ingredient tagging

Every recipe in the database carries a set of ingredient tags. Tags are simple strings like “contains_gluten”, “contains_dairy”, “contains_nuts”, “vegan”, “vegetarian”. I built the tag set by parsing the ingredient list and matching against a curated dictionary of allergens and diet labels.

Rule application

When you submit your restrictions I create a Boolean rule for each tag. For example, if you chose gluten‑free the rule is “NOT contains_gluten”. If you chose vegan the rule is “vegan”. All rules are combined with AND logic, meaning a recipe must satisfy every rule to pass the filter.

Performance note

The filter runs as a database query that indexes the tag columns. This keeps response time under two seconds even with a recipe catalog of fifteen thousand entries. I avoid loading the full recipe set into memory; instead I let the search engine do the heavy lifting.

Where the meal ideas come from

Recipe library sources

I maintain a library of simple meals that require ten ingredients or fewer and steps that can be completed in three pans or less. Sources include open‑access cooking sites, government nutrition databases, and contributions from early users who shared their go‑to weeknight dishes. Each recipe entry stores title, ingredient list, step‑by‑step instructions, prep time, cook time, and macro totals per serving.

Updating the library

Every month I run a script that checks for broken links and removes recipes that have been flagged as too complex. I also add new recipes that meet the simplicity criteria and that have been tested by at least two users for taste and ease. The script logs any changes so I can revert if a new addition causes unexpected filter results.

Tagging for macro density

Besides diet tags I compute macro density values: calories per gram of protein, fat, and carbohydrate. These values help the assembly algorithm pick recipes that hit the macro split without exceeding the calorie target.

How the week is assembled

Now I have a filtered list of recipes that match your goal and restrictions. The assembly step picks seven meals — one breakfast, one lunch, one dinner for each day — while keeping variety and respecting your prep‑time ceiling.

Scoring each candidate

For each recipe I compute a score that combines three factors: macro fit, time fit, and repetition penalty. Macro fit measures how close the recipe’s protein, fat, and carbs are to the daily targets you set. Time fit gives a higher score to recipes whose prep time is below your limit. Repetition penalty reduces the score of a recipe if it has already been chosen for another meal in the same week.

Choosing the meals

I run a greedy selection loop: for each meal slot I sort the remaining recipes by score and pick the top one. After a recipe is chosen I apply the repetition penalty to its copies and continue to the next slot. This process repeats until all seven slots are filled.

Balancing across the day

To avoid putting a heavy dinner on every night I enforce a rule that the total calories for dinner cannot exceed 35 % of the daily target on more than three days. If the greedy pick violates this rule I look at the next best recipe that satisfies the dinner limit.

Example output table

Day Breakfast Lunch Dinner Prep time (min)
Monday Greek yogurt with berries Quinoa chickpea salad Stir‑fried tofu with broccoli 25
Tuesday Spinach omelette Turkey lettuce wraps Baked salmon with asparagus 30
Wednesday Overnight oats Lentil soup Chicken thigh sheet pan 20
Thursday Protein smoothie Veggie hummus wrap Turkey meatballs with zucchini noodles 28
Friday Avocado toast Tuna salad lettuce cups Shrimp stir fry 22
Saturday Banana pancakes Falafel pita Veggie lasagna (gluten‑free) 45
Sunday Veggie frittata Chicken Caesar salad Beef and vegetable stew 35

The table shows one possible week that respects a 30‑minute prep‑time limit on weekdays and allows a longer cook‑time meal on the weekend. You can drag any meal to a different day or replace it with another option from the filtered list before you finalize the plan.

What this is NOT

I do not promise that every meal will match your taste preferences. The system selects recipes based on goal, restrictions, and time, not on flavor profiles you might love or dislike.

I do not guarantee that you will lose or gain a specific amount of weight. Nutrition targets are estimates; actual results depend on many factors outside the software, such as sleep, stress, and individual metabolism.

I do not claim that the plan is 100 % free of allergens. While I filter out ingredients you flagged, cross‑contamination in shared kitchens or mislabeled products can still pose a risk.

I do not offer a substitute for professional medical advice. If you have a medical condition that affects diet you should consult a qualified health practitioner before relying on any automated plan.

I do not assert that the service will never make a mistake. Like any software that relies on third‑party data, occasional errors in ingredient tagging or macro calculations can occur.

Operator checklist for How does MealPlanner build the week?

I keep a written checklist next to every release that touches this topic. The list is boring on purpose: name the owner, name the evidence artifact, and name the rollback. If a step cannot produce a file, a ticket, or a log line, it is not a step — it is a wish.

Before you change production

While you run the check

After you finish

SignalWhat to recordStop-ship?
Unexpected write or sendTool name, args, identityYes until gated
Missing confirmation on destructive actionCall path and bypassYes
Untrusted text treated as instructionSource surface and resulting actionYes for agent reach
Scanner clean, judgment openDeferred items + ownerOnly if core path safe

meal-planner helps with the measurable first pass. Architecture choices, legal sign-off, and customer-facing claims still need a human owner. Treat every checklist row as decision support, not a certificate.

How I explain limits to buyers

When a prospect asks whether the product "covers everything," I answer with the boundary: automated checks catch known patterns; novel chains and policy judgment still need review. That honesty keeps support load down and keeps the blog aligned with what the product actually does.

If you need a second opinion, pair this write-up with the references below and with your own staging reproduction. Do not skip the reproduction step just because a model wrote a confident summary.

References

Frequently asked questions

What is How does MealPlanner build the week??

Set a goal and dietary restrictions and it returns a 7-day plan of simple meals, so you eat better without a spreadsheet or a meal-prep obsession.

References

Try meal-planner