Before writing a recipe from scratch, it is often useful to discover whether someone else has already written one that meets (or comes close to meeting) your needs. The Yocto Project and OpenEmbedded communities maintain many recipes that might be candidates for what you are doing. You can find a good central index of these recipes in the OpenEmbedded metadata index.
Working from an existing recipe or a skeleton recipe is the best way to get started. Here are some points on both methods:
Locate and modify a recipe that is close to what you want to do: This method works when you are familiar with the current recipe space. The method does not work so well for those new to the Yocto Project or writing recipes.
Some risks associated with this method are using a recipe that has areas totally unrelated to what you are trying to accomplish with your recipe, not recognizing areas of the recipe that you might have to add from scratch, and so forth. All these risks stem from unfamiliarity with the existing recipe space.
Use and modify the following skeleton recipe:
SUMMARY = ""
HOMEPAGE = ""
LICENSE = ""
LIC_FILES_CHKSUM = ""
SRC_URI = ""
SRC_URI[md5sum] = ""
SRC_URI[sha256sum] = ""
S = "${WORKDIR}/${PN}-${PV}"
inherit stuff
Modifying this recipe is the recommended method for creating a new recipe. The recipe provides the fundamental areas that you need to include, exclude, or alter to fit your needs.