How to create Alexa skills
Alexa skills are today, where Facebook was before your business had a Facebook page. You can delay the inevitable, but your business will need an Alexa skill sometime in the near future.
What is an Alexa skill?
By now everyone knows what an “app” is – but not everyone knows what an Alexa skill is or how to use them. Although, in a few years, everyone will know what an Alexa skill is in the same way they know what an app is – and everyone will use them just as often.
Let’s stay with the iPhone analogy to briefly explain what a skill is: if you get a new iPhone, it works right out of the box. You can make calls, set timers, even look at maps. But the real fun begins when you add additional apps. Now you can book flights, read newspapers, trade stocks – whatever you want to do, “there is an app for that”. The same goes for Alexa; if you get a new Amazon Echo device, it comes with built-in features – again, setting timers, asking questions, getting weather information. But, very much like an app on your iPhone, you can extend Alexa’s functionality by using one of the over-100,000 Alexa skills available. Getting translations, cooking recipes, playing games – “there is a skill for that”.
Now the question arises: How can I build an Alexa skill?
How can I build an Alexa skill?
In general, you have to ask yourself these two questions:
How much development knowledge and experience do I have?
How much am I willing to pay someone with development knowledge and experience?
Depending on your answer to these questions, you can choose to develop your skill from scratch or use one of the existing “no-code” tools (tools that don’t require development skills or knowledge). You can find an introduction to these tools in our blog post "Create Alexa skills without coding".
Developing your skill from scratch gives you maximum flexibility; you can basically do anything – for the cost of complexity. If you choose a no-code solution, you might think that your possibilities are limited – but that is not the case anymore. We have covered all the options to create Alexa skills without coding (as we already said: in a separate post) and recommend that you start with the no-code approach first, but if you have a hardcore interest in the technical aspects of creating an Alexa skill, we will now describe what needs to be done to create an Alexa skill from scratch.
How to build an Alexa skill from scratch
Amazon provides the Alexa skills kit (ASK) which is part of the Amazon developer console. ASK is the starting point for any new skill, therefore, you need to have a (free) Amazon developer account.
When creating a skill, you must first define the type of skill you want to build. We will focus on “custom skills” which will give you maximum flexibility, but there are lots of other types for special purposes that you can find at https://developer.amazon.com/en-US/docs/alexa/ask-overviews/list-of-skills.html.
If you start with a custom skill, you can choose from different templates to give you a head-start. I.e., “Scheduling,” “Survey,” etc. will pre-fill your skill with functionality, but don’t worry – you can build any functionality you want without using these templates.
Invocation name
The first thing you need to define is the so called “invocation name” – this will be used by the user to invoke the skill. So if your business would be called “Jen and Terry,” that would also be a good invocation name; your customers would start your skill by saying “Alexa, open Jen and Terry”. There are certain rules to what invocation names must look like, so make sure you regard them. You can find them at: https://developer.amazon.com/en-US/docs/alexa/custom-skills/choose-the-invocation-name-for-a-custom-skill.html#cert-invocation-name-req.
Intents
After a user has started your skill by saying the invocation name, they will try to trigger certain actions in your skills. These are called “intents”. E.g., the user says, “Are you open currently?”. If you have defined an intent like “OpeningHoursIntent” that listens to this utterance, this event will be triggered. So, your next step is to define all the intents that the user might trigger, and then find the example utterances for this intent. With intents in our example, such as, “Can I come right now?” or “Are you available?”, Alexa is smart enough to figure out what the user wants to know even if you have not defined the utterance exactly. So, in our example, “Can I come right now?” should also trigger the right intent, despite it not being defined explicitly.
Intent slots
Intents can also have slots. In our example, the user might say, “Are you open on Sunday?” or “Are you open on Tuesday?”. The last part is variable – the so-called “slot”. You can define the slots that you want to use in the style of “Are you open on {weekday}?”. “Weekday” will now contain the value that the user has said.
Fulfilling the intents
After the user has finished his request and the correct intent with the corresponding slots was identified, the data is sent to an “endpoint”. An endpoint might be a webserver you own or a Lambda function.
As you build a custom skill, it is totally up to you what happens at this endpoint. You will receive a webservice request from Amazon that contains information about the intent, to which you will respond with a valid response that Amazon can understand and convert to the response that the user hears.
In our example, your server would receive a request from Amazon like this: {Intent = OpeningHoursIntent; Slots = weekday:Sunday}. Your server would now determine if you are open on Sunday and create a response based on this. A response can either be text (an answer which is then read by Alexa) or an audio file (which will be played).
Testing your skill
Amazon provides different possibilities to test your skill before you make it available for the public.
You can test your skill right away in the testing section of the ASK. It’s a great place to debug because you see every detail.
If testing is enabled in the ASK test console, you can use the skill right away on all the devices that are connected to the same Amazon account that you used to create the skill.
If you want to invite other people to test your skill, you can start a beta test. Anyone with an Amazon account can be invited. A beta test runs for 90 days, but you can start as many as you want to.
Certification
No matter how you built your skill, in the end you want to let the world know about it and between you and the world, lies the big stone of the “Amazon certification”. Every skill is checked by a dedicated certification team for stability and to see if the content is working as expected. By doing this, Amazon ensures that all skills maintain a certain quality.
We have been developing skills since 2017, and we have experienced the funniest and most surreal stories with the certification team – but if you keep it simple, your skill will be ready for public use!
Even the “hard” way is not that hard. With a little bit of time and development experience, you can get your business on Alexa (the sooner, the better).
And if you read through all that and are interested in the “easy” way, check out our Alexa skill services.