THIS IS a story about satisfying compulsion, getting organized, killing several birds with one stone, reining in romantic notions and masquerading as Lady Bountiful. It is also a story about food. Good things from the garden that can be shared with friends and family. Cheaply and without spending a weekend in the kitchen.

The guiding principle behind accomplishing all this is something called Gardening by the Cookbook, subtitled Grow Your Gifts, and I discovered it after several feeble attempts to live out a fantasy that has been popularized by some food and life style magazines in recent years -- namely "the farmhouse epicure."

Here's how the farmhouse-epicure storyline goes: Gorgeous, full-color photographs of well-mulched gardens, pole beans twining gracefully up trellises, neat hedges of herbs with a sundial plopped in their midst. Cut to more gorgeous pictures of the garden's bounty transformed into wonderful foodstuffs for the larder. Enticing recipes to follow.

Fueled by such stories and a little imagination, an intown apartment or Cape Cod in the suburbs magically metamorphoses in to a fieldstone farmhouse with an herb garden conveniently located near the kitchen door. Within, freshly picked strawberries simmer in a preserving kettle (hammered copper, $250) on top of a professional Garland range ($1,320) while a calico cat naps in a corner. Handwoven baskets ($60 to $125) hang decoratively over an old pine kitchen table where a jelly bag slowly drips the essence of crabapple. Row upon gleaming row of filled preserving jars line the shelves of a 19th-century hutch. Laura Ashley fabrics flap gently at the windows. Potted pink geraniums are set randomly on the highly polished tile floor.

It's enough to send you racing to the nearest Burpee seed catalog or nursery, which is exactly what happened several years back. Three kinds of lettuce (Black Seeded Simpson, Bloomsdale Long Standing, Paris White), four kinds of tomatoes (cherry, Better Boys, Rutgers, Italian plum) and peppers (banana, bell, chili, jalapeno). Carrots, beets, scallions, summer squash, zucchini, eggplant, eight or nine varieties of herbs. One summer, 60 tomato plants alone.

"Are you crazy?" asked my father, a gardener of nearly 50 years' standing, when he saw the flats of tomato plants. "I've never planted more than a dozen in my entire life."

Despite warnings like this, things in the garden stayed reasonably in control through late July. Though the sugar snap peas were a bust, the scallions and lettuce, until it bolted, were convenient for salad-making, and fresh herbs got snipped into all sorts of dishes.

But by August, what to my eye had been a kind of free-form, English-cottage type of horticultural arrangement had turned into a jungle. Curling vines of zucchini threatened to choke off some of the tomato crop--really no hardship at that point since there always seemed to be three colanders of picked tomatoes in the kitchen waiting for the cook to summon the energy to do something homey and appropriately picturesque with them.

But it never got done. Between pulling weeds and trying to pawn off vegetables on anyone who would promise to take good care of them, exhaustion and confusion had set in. No gleaming jars of preserved goods lined the pantry shelf. All the clipped recipes, for goodies that were to be, languished on the kitchen scales. So much for fantasy.

In the fall--the time when all super-organized gardeners start plotting next year's battle plan--I hit on the idea of Gardening by the Cookbook. Instead of planting willy-nilly and then searching, crisis-management style, through cookbooks for quick uses, why not plan around recipes I wanted to try and organize my Christmas and birthday lists at the same time? Under this plan, then, the dill and the string beans for Dilly Beans got the nod, while the swiss chard stayed on the seed shelf.

The plan seemed to solve several problems at once. It satisfied a need to impose some sort of order on the garden, it prevented my wondering what on earth to do with that half-bushel of kohlrabi, and it encouraged experimenting with all those recipes that had been clipped and dogeared.

Overall, it worked. There were overruns of jalapeno peppers (the excess got packed in jars with vinegar and water and refrigerated). And only my 20-month-old friend William would eat the plum tomatoes (which mysteriously sprouted the size of the cherry variety).

But the kitchen this year has been full of gleaming preserving jars, and with the addition of attractive labels, handsome containers and leftover scraps from the sewing basket, this plan has solved the continuous problem of quick and inexpensive gifts. A nice alternative to the usual bottle of wine for the hosts. Best of all, perhaps, a bottle of basil vinegar or jar of homemade tomato sauce carries a personal touch, whether cooked up in a fieldstone farmhouse or city kitchen. And that's what planning your garden around the foods you love is all about.

Here are some gifts-to-be from the garden, and some hints for packaging them.

* Though there are a number of handsome jelly and clamp-lidded jars on the market, salvaged containers can be equally attractive. Mustard, preserve, pimiento and baby food jars are particularly good for jellies. And if the print cannot be removed from the lid, cover with a circle of fabric secured with a rubber band or ribbon. Grolsch beer bottles with the china stoppers are excellent for vinegars, as are the faceted one-liter bottles carried by kitchenware shops. Canning jars with tight-fitting lids and unused sealers must be used if the food is to be processed.

* Whimsical labels and stickers are available from most local kitchenware shops, housewares sections of department stores and stationers like The Written Word in Georgetown and at Dupont Circle.

* Be sure to include suggestions for your gift's use. For instance, a mint vinegar might be used to deglaze a roast leg of lamb or to point up a fruit salad dressing. You might also consider packaging your homemade gift--say, a tomato sauce, with a wedge of parmesan and a good brand of pasta like de Cecco--for an instant dinner.

SHERRIED PEPPERS (Makes about 1 quart)

Nothing could be simpler to prepare than this condiment. The peppers add fire to Latin American dishes and the liquid can be stirred into stews, pot roasts and Bloody Marys. By replacing the sherry as it is used, this supply should last indefinitely. A clean 1-quart jar or decanter 3/4 to 1 pound red and green chili peppers Boiling water to cover 12 whole cloves 1 tablespoon lemon peel, scraped of white pith 12 black peppercorns 1 teaspoon Beau Monde seasoning 3 cups dry or cocktail sherry (or enough to cover)

Sterilize jar by filling with boiling water, and set aside. Be sure to wear kitchen gloves when handling chili peppers; their volatile oil can irritate skin or eyes. Wash peppers thoroughly and place in bowl. Cover with boiling water and let sit 2 to 3 minutes. Drain in colander. Pour water out of jar and spoon a third of the peppers into the jar. Drop in 4 cloves, 1 teaspoon lemon peel, 4 peppercorns and some of the seasoning mixture. Repeat twice more with remaining peppers and seasonings. Add sherry to cover peppers completely. Cap jar securely and let sit a month before using. You may need to add more sherry as peppers absorb the liquid. (From "The Southern Hospitality Cookbook," Winifred Green Cheney)

DILLY BEANS (Makes 4 pints)

The amount of cayenne can be adjusted to taste, but the beans should be fairly hot. Addictive with cocktails. 2 pounds green beans 1 teaspoon cayenne pepper 4 cloves garlic, peeled 4 bushy branches fresh dill (or substitute 4 teaspoons dried dill or 4 tablespoons dill seed) 1/2 cup salt 2 1/2 cups cider vinegar 2 1/2 cups water

Choose long, unblemished green beans and trim ends if desired. Wash under cold water and drain. Sterilize 4 pint jars, then pack beans lengthwise into the hot jars, leaving 1/2-inch headspace. To each jar add 1/4 teaspoon cayenne, 1 clove of garlic and 1/4 of the dill. Combine salt, vinegar and water in a saucepan and bring to a boil. Pour boiling liquid over beans to cover, leaving a 1/4-inch head space. Remove any air bubbles by stirring gently with a chopstick. Cover jars with tightly fitting lids and caps and process 10 minutes in a hot water bath.

HOT PEPPER JELLY (Makes 7 8-ounce glasses)

A long-time southern favorite, this jelly's tangy bite complements lamb, pork or beef roasts and it can be spread over a block of cream cheese and served with crackers as a colorful appetizer. 1 1/2 cups cider vinegar, divided 1 cup green bell peppers, seeded and chopped 1/3 to 1/2 cup jalapeno peppers, seeded and chopped 1 medium onion, chopped 5 1/2 to 6 cups sugar Green or red food coloring 6-ounce bottle liquid fruit pectin Melted paraffin (if not using lidded jars)

Be sure to wear kitchen gloves when handling jalapeno peppers; their oils, too, can irritate the eyes and skin. Place 1/2 cup of vinegar with both peppers and the onion in a blender or food processor fitted with the steel blade. Reduce vegetables to a fine pure'e. Pour contents through a fine strainer or a cheesecloth-lined colander set over a large kettle; mash solids against sides with a wooden spoon so that all juice is released, then discard solids. Add remaining vinegar, the sugar and a few drops of food coloring to the juice. Bring to a rolling boil, stirring constantly for several minutes. Remove from heat and let sit for 5 minutes. Skim off any foam that rises to top. Stir in liquid pectin. Pour into hot sterilized jars (a measuring cup is handy for pouring). If not using lids, cover jelly with an 1/8-inch coat of melted paraffin. (Adapted from "The Southern Hospitality Cookbook," Winifred Green Cheney)

PRESERVED HERBS

The best choices for preserving are basil, tarragon, oregano and marjoram. Do not add garlic, as it will overwhelm the herbs and may turn bitter-tasting. Wash leaves thoroughly and dry completely on paper towels. Place in clean glass jars or freezer containers and cover completely with a good, fruity olive oil. Be sure to stir the oil through. The herbs can be removed as needed for preparing recipes and the aromatic oil used in salad dressings. If intended as a gift, be sure to include several recipes for using the preserved herb.

HERB VINEGARS

Flavored vinegars are showing up in more than the usual salads these days. Basil tarragon, rosemary and spearmint are all good candidates. Be sure to use high-quality white wine vinegar; the Spice Island brand is pleasant and relatively inexpensive when compared with imported varieties. Best of all, once the label is removed, the bottle can be refilled with the flavored vinegar. 3 to 4 cups loosely packed herb leaves 4 to 5 cups white wine vinegar 2 garlic cloves, peeled and halved 6 black peppercorns

Wash herbs and pat dry. Place in a sterilized jar with a wide mouth (apple juice jars are good) and bruise leaves with a wooden spoon. Heat vinegar to a simmer and pour over herbs. Add garlic and peppercorns to jar (these, however, should be omitted if making mint vinegar). Cover jar and let stand. After one day, remove garlic. After 14 days, strain vinegar through cheesecloth into a saucepan and heat to a simmer. Pour into sterililzed bottles, leaving 1/2-inch headroom and adding a sprig of fresh herb that has been thoroughly washed and dried. Top with tightly fitting caps.