The basic pantry is the twenty or so products that let you make a meal without having been to the shop. Once you have them, most simple recipes only need one or two fresh ingredients on top. In disheazy, this cupboard has a name: the pantry.
When you use the last one, that is the moment you put it back on the list, not the moment you need it.
One first time to build it, then it looks after itself with the shopping list.
Something is missing: look at what you have first. Pasta, eggs and grated cheese make a meal. Rice, a can of tuna and a can of corn too. Canned lentils, an onion and a carrot make a salad or a soup.
Pasta with butter and parmesan: everything is already in the cupboard.