Building an Alexa Trivia Skill

So you have heard a lot about Amazon’s virtual voice assistant Alexa or maybe you haven’t and you were under a rock during all the advertising for their Echo product. Well now that it is a hit, Amazon has opened up to the community to develop skills (similar to apps) that you can make for Alexa that users can install and use hands-free using voice commands. In less than one year the company has reached 1,000 third-party skills developed from the community.

Now enough back story, here is my experience developing my first skill for Alexa.


Starting Out

Amazon has created some great resources to help programmers tip toe into the process in developing skills and deploying them. For my first skill I decided to create a Trivia Skill that is game-based and allows the user to listen to trivia question followed by four answers with one being the correct answer. For my trivia game I decided on presidential candidate 2016 trivia, mainly because of all the political excitement on my Facebook newsfeed and all the awkward debates on my office floor. There are a lot of quirky things about our presidential candidates — if you don’t believe me — go download my skill on your Echo or Alexa-enabled device. To get started you can follow the great tutorial I used HERE.


What I Learned

JavaScript (Node JS) is still fairly new to me as I learned on Ruby, but I found it easier to follow along that I expected. The actual layout is easy to understand. Their is also a great free Udemy video resource that helps explain some of the new terminology associated with Alexa and some of the basic fundamentals you need to know going into making your first skills. You will find that you have four basic pieces to your skill build:

  1. Intent Schema — maps the intents your user has when using your trivia skill
  2. Example: AnswerIntent — was my intent that was looking for the answer from the user
  1. Custom Slot Types — references your intent schema and sample utterances
  2. Example: 1, 2, 3, 4 — these were the numbers corresponding to the answers fielded by Alexa
  1. Sample Utterances — these are the utterances your user might use to work your skill
  2. Example: the answer is {Answer} — these can be improved on during your testing phase
  1. AWS Lambda — This is where you will upload your actual code or your index.js file that you built and customized from the tutorial I mentioned before

Many of these will take some thought when you are constructing your skill to make sure it is user-friendly and isn’t only catered to how you would do a particular thing.


What was Challenging

Nothing was necessarily “super challenging”, it was new and therefore took me some time getting used to Amazon’s developer resources as I was unfamiliar with them. A developer that is familiar with Amazons developer resources will probably have an easier time navigating through all the tools Amazon has to offer. As mentioned previously, I was unfamiliar with JavaScript as well so I had to research a little here or there to get what I wanted. This skill was pretty basic, and is great at introducing how to work with Alexa. This was the foundation in building my next two skills.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.