This is the first of a series posts in which I will be building an Alexa Skill. I haven’t pre-written this series, so I don’t know where it’s going to end up, or even the exact steps that will occur along the way. What it will be is something closer to how development would occur in the real world as opposed to a sanitized tutorial.
The skill I’ll be building is one for my church. It will let users ask for the time of the next service or event. You can also ask it for the church address and phone number. And we’ll see what other interesting things we can add. If you dislike church’s for some reason, feel free to substitute your favorite civic organization .
Here are the prerequisites for the tutorial:
- An AWS developer account.
- You have Node.js installed. Let’s go!
- If you would like a tutorial for configuring the environment from scratch, let me know. I’ve found this information easily enough with Google that I didn’t think I needed it here. When I write a complete book, I should probably include it (right?).
Install the Alexa Skill Kit Command Line Interface (ask-cli)
Initialize the ask-cli
Create a new skill with the ask-cli
At the top level of the project, a file called
skill.json is created. This file contains the skill manifest (Skill Manifest API) and is the JSON representation of the skill.
publishingInformation object describes how the skill is presented to end users in the skill store or Alexa app. The supported locales, description, category (list of categories), and other information is contained as shown below.
apis object describes the HTTP endpoint that processes the intents that the skill supports. The
apis object shown below configures the endpoint to be an AWS Lambda function that is defined in the
lambda/custom directory of this project.
The manifest can also contain (
permissions)[https://developer.amazon.com/docs/smapi/skill-manifest.html#permissions], and (
events)[https://developer.amazon.com/docs/smapi/skill-manifest.html#events] which you can read about, but aren’t used yet in this project (if we do end up needing any of them I’ll describe them at that time).
models/en-US.json file contains the Interaction Model ((Interaction Model Schema)[https://developer.amazon.com/docs/smapi/interaction-model-schema.html]) of the skill. The
languageModel defines the interactions that Skill supports. The
invocationName is the set of words that activates your skill. My Skill is for my church, Shepherd of the Valley, so I went with s.o.t.v. which will open my skill when you say something like, “Alexa, open S-O-T-V.”
intents section are the intents your skill will respond to. I didn’t list all the built in ones, but they are
AMAZON.StopIntent. The first non-built-in intent my skill will support is the
samples is an array of phrases also called utterances. These utterances are what will activate the intent for that skill. For example, “Alexa, tell S-O-T-V to say hello.”
That describes the definition of the skill. In the next post, I’ll walk through the supporting code.